Add KeyBindingBehavior
This commit is contained in:
@@ -17,47 +17,9 @@
|
||||
<Style Selector="ui|SettingsExpander /template/ Expander#Expander ToggleButton">
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
|
||||
</Style>
|
||||
<Style Selector="Button">
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
|
||||
</Style>
|
||||
<Style Selector="TextBox">
|
||||
<Setter Property="CornerRadius" Value="0" />
|
||||
<Setter Property="BorderThickness" Value="0 0 0 2" />
|
||||
<Style Selector="^:focus">
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0 0 0 2" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="OverlayPopupHost">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<!-- Do not forget to update Templated_Control_With_Popup_In_Template_Should_Set_TemplatedParent test -->
|
||||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
||||
<VisualLayerManager IsPopup="True">
|
||||
<LayoutTransformControl>
|
||||
<LayoutTransformControl.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.4" ScaleY="1.4" />
|
||||
</LayoutTransformControl.LayoutTransform>
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</LayoutTransformControl>
|
||||
</VisualLayerManager>
|
||||
</LayoutTransformControl>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Application.Styles>
|
||||
<Application.Resources>
|
||||
<Thickness x:Key="TextControlThemePadding">0,5,6,6</Thickness>
|
||||
<FontFamily x:Key="SymbolFontFamily">avares://HyperX.Launcher.Avalonia/Assets/SegoeIcons.ttf#Segoe Fluent Icons</FontFamily>
|
||||
<StaticResource x:Key="TextControlBackground" ResourceKey="ControlFillColorTransparentBrush" />
|
||||
<StaticResource x:Key="TextControlBackgroundPointerOver" ResourceKey="ControlFillColorTransparentBrush" />
|
||||
<x:Double x:Key="SettingsExpanderItemAdaptiveWidthTrigger">0</x:Double>
|
||||
<Thickness x:Key="SettingsExpanderItemBottomFooterMargin">0,8,0,0</Thickness>
|
||||
</Application.Resources>
|
||||
|
||||
@@ -36,8 +36,7 @@ public partial class App : Application
|
||||
services.AddTemplate<MainViewModel, MainView>("Main");
|
||||
services.AddHandler<MainViewModelHandler>();
|
||||
|
||||
services.AddConfiguration<VaultConfiguration>(args => args.Name = "Personal",
|
||||
$"{nameof(VaultConfiguration)}:Personal");
|
||||
services.AddConfiguration<VaultConfiguration>(args => args.Name = "Personal", "Vault:Personal");
|
||||
})
|
||||
.Build();
|
||||
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Bitvault.Avalonia.LockView"
|
||||
Title="LockView">
|
||||
Welcome to Avalonia!
|
||||
</Window>
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.LockView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBox
|
||||
Width="300"
|
||||
Classes="revealPasswordButton"
|
||||
PasswordChar="●">
|
||||
<TextBox.KeyBindings>
|
||||
<KeyBinding Gesture="Enter" />
|
||||
</TextBox.KeyBindings>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class LockView : UserControl
|
||||
{
|
||||
public partial class LockView : Window
|
||||
{
|
||||
public LockView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
public LockView() => InitializeComponent();
|
||||
}
|
||||
|
||||
@@ -16,5 +16,7 @@ public class VaultComponent :
|
||||
services.AddTemplate<ArchiveNavigationViewModel, ArchiveNavigationView>();
|
||||
|
||||
services.AddTemplate<VaultViewModel, VaultView>("Vault");
|
||||
services.AddTemplate<LockViewModel, LockView>("Lock");
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,4 +5,10 @@
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:VaultNavigationViewModel"
|
||||
Content="{Binding Name}"
|
||||
MenuItemsSource="{Binding}" />
|
||||
MenuItemsSource="{Binding}">
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Loaded">
|
||||
<NavigateAction Context="Main" Route="Lock" />
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</NavigationViewItem>
|
||||
|
||||
Reference in New Issue
Block a user