Improve sub navigations
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
<NavigateAction Region="Left" Route="ContentItemCollection">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
<Parameter Key="Transition" Value="FromRight" />
|
||||
<Parameter Key="NavigationStackEnabled" Value="{x:True}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
|
||||
@@ -105,10 +105,11 @@ public partial class App : Application
|
||||
services.AddTemplate<ItemCollectionViewModel, ItemCollectionView>("ContentItemCollection");
|
||||
services.AddHandler<AggerateLockerItemViewModelHandler>();
|
||||
|
||||
services.AddTemplate<SearchLockerActionViewModel, SearchLockerActionView>();
|
||||
services.AddTemplate<LockerHeaderViewModel, LockerHeaderView>("LockerHeader");
|
||||
|
||||
services.AddTemplate<BackActionViewModel, BackActionView>();
|
||||
services.AddTemplate<CreateItemActionViewModel, CreateItemActionView>();
|
||||
services.AddTemplate<SearchLockerActionViewModel, SearchLockerActionView>();
|
||||
|
||||
services.AddTemplate<ItemCategoryCollectionViewModel, ItemCategoryCollectionView>("LockerItemCategoryCollection");
|
||||
services.AddTemplate<ItemCategoryNavigationViewModel, ItemCategoryNavigationView>();
|
||||
|
||||
@@ -116,6 +117,7 @@ public partial class App : Application
|
||||
|
||||
services.AddTemplate<ItemNavigationViewModel, ItemNavigationView>();
|
||||
services.AddTemplate<ItemViewModel, ItemView>("Item");
|
||||
|
||||
services.AddHandler<AggerateItemViewModelHandler>();
|
||||
|
||||
services.AddTemplate<ItemCommandHeaderViewModel, ItemCommandHeaderView>("ItemCommandHeader");
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<NavigateAction Region="Left" Route="ContentItemCollection">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
<Parameter Key="Transition" Value="FromRight" />
|
||||
<Parameter Key="NavigationStackEnabled" Value="{x:True}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.BackActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<x:Double x:Key="ButtonWidth">40</x:Double>
|
||||
<x:Double x:Key="ButtonHeight">36</x:Double>
|
||||
<SolidColorBrush x:Key="ButtonBackground" Color="{DynamicResource SubtleFillColorTransparent}" />
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="{DynamicResource SubtleFillColorSecondary}" />
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="{DynamicResource SubtleFillColorTertiary}" />
|
||||
<Thickness x:Key="ButtonBorderThemeThickness">0</Thickness>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<SolidColorBrush x:Key="IconForegroundBrush" Color="#AB000000" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<SolidColorBrush x:Key="IconForegroundBrush" Color="#ABFFFFFF" />
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Back">
|
||||
<TextBlock
|
||||
Margin="0,3,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Click">
|
||||
<NavigateBackAction Region="Left" />
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,9 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class BackActionView : UserControl
|
||||
{
|
||||
public BackActionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -30,6 +30,7 @@
|
||||
<EventTriggerBehavior EventName="Click">
|
||||
<NavigateAction Region="Left" Route="LockerItemCategoryCollection">
|
||||
<Parameter Key="Transition" Value="FromRight" />
|
||||
<Parameter Key="NavigationStackEnabled" Value="{x:True}" />
|
||||
</NavigateAction>
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
|
||||
@@ -4,4 +4,31 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ItemCategoryNavigationViewModel"
|
||||
Content="{Binding Name}" />
|
||||
Content="{Binding Name}"
|
||||
IsSelected="{Binding Selected, Mode=TwoWay}">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Selected}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction
|
||||
Region="{Binding Named, StringFormat='{}{0}:Content'}"
|
||||
Route="Item"
|
||||
Scope="self">
|
||||
<Parameter Key="Immutable" Value="{x:False}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</AttachedBehaviour>
|
||||
<DataTriggerBehavior Binding="{Binding Selected}" Value="True">
|
||||
<NavigateAction
|
||||
Region="{Binding Named, StringFormat='{}{0}:Content'}"
|
||||
Route="Item"
|
||||
Scope="self">
|
||||
<Parameter Key="Immutable" Value="{x:False}" />
|
||||
</NavigateAction>
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</ListBoxItem>
|
||||
|
||||
@@ -2,7 +2,7 @@ using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class ItemCategoryNavigationView : UserControl
|
||||
public partial class ItemCategoryNavigationView : ListBoxItem
|
||||
{
|
||||
public ItemCategoryNavigationView() =>
|
||||
InitializeComponent();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
Grid.Row="0"
|
||||
Grid.ColumnSpan="3"
|
||||
Height="44"
|
||||
Margin="8,0,0,0">
|
||||
Margin="4,2,0,0">
|
||||
<ContentControl VerticalAlignment="Center">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<NavigateAction Region="Left" Route="ContentItemCollection">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
<Parameter Key="Transition" Value="FromRight" />
|
||||
<Parameter Key="NavigationStackEnabled" Value="{x:True}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
|
||||
Reference in New Issue
Block a user