vault unlocking WIP
This commit is contained in:
@@ -76,7 +76,7 @@ public partial class App : Application
|
||||
services.AddTemplate<ArchiveNavigationViewModel, ArchiveNavigationView>();
|
||||
|
||||
services.AddTemplate<VaultViewModel, VaultView>("Vault");
|
||||
services.AddTemplate<LockViewModel, LockView>("Lock");
|
||||
services.AddTemplate<OpenVaultViewModel, OpenVaultView>("Open");
|
||||
});
|
||||
})!);
|
||||
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.UI.Controls.Avalonia\Toolkit.UI.Controls.Avalonia.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="OpenVaultView.axaml.cs">
|
||||
<DependentUpon>OpenVaultView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ManageNavigationView.axaml.cs">
|
||||
<DependentUpon>ManageNavigationView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class LockView : UserControl
|
||||
{
|
||||
public LockView() => InitializeComponent();
|
||||
}
|
||||
@@ -8,6 +8,10 @@
|
||||
FooterMenuItemsSource="{Binding Footer}"
|
||||
MenuItemTemplate="{Binding Template}"
|
||||
MenuItemsSource="{Binding}">
|
||||
<NavigationView.Resources>
|
||||
<CornerRadius x:Key="NavigationViewContentGridCornerRadius">0</CornerRadius>
|
||||
<Thickness x:Key="NavigationViewContentGridBorderThickness">1,0,0,0</Thickness>
|
||||
</NavigationView.Resources>
|
||||
<Frame x:Name="Main">
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Loaded">
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.LockView"
|
||||
x:Class="Bitvault.Avalonia.OpenVaultView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:LockViewModel">
|
||||
x:DataType="vm:OpenVaultViewModel">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBox
|
||||
Width="300"
|
||||
@@ -12,7 +12,7 @@
|
||||
Text="{Binding Password}">
|
||||
<Interaction.Behaviors>
|
||||
<KeyBindingTriggerBehavior Gesture="Enter">
|
||||
<InvokeCommandAction Command="{Binding UnlockCommand}" />
|
||||
<InvokeCommandAction Command="{Binding InvokeCommand}" />
|
||||
</KeyBindingTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</TextBox>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class OpenVaultView : UserControl
|
||||
{
|
||||
public OpenVaultView() => InitializeComponent();
|
||||
}
|
||||
@@ -5,10 +5,39 @@
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:VaultNavigationViewModel"
|
||||
Content="{Binding Name}"
|
||||
IsExpanded="{Binding Expanded, Mode=TwoWay}"
|
||||
IsSelected="{Binding Selected}"
|
||||
MenuItemsSource="{Binding}">
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding Opened}" Value="False">
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Selected}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Context="Main" Route="Open" />
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding Opened}" Value="True">
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Selected}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Context="Main" Route="Vault" />
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
<EventTriggerBehavior EventName="Tapped">
|
||||
<NavigateAction Context="Main" Route="Lock" />
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Opened}" RightOperand="False" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Context="Main" Route="Open" />
|
||||
</ConditionAction>
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</NavigationViewItem>
|
||||
|
||||
Reference in New Issue
Block a user