Fix more edge cases
This commit is contained in:
@@ -110,12 +110,12 @@ public partial class App : Application
|
||||
services.AddTemplate<ItemCategoryCollectionViewModel, ItemCategoryCollectionView>("ItemCategoryCollection");
|
||||
services.AddTemplate<ItemCategoryNavigationViewModel, ItemCategoryNavigationView>();
|
||||
|
||||
services.AddHandler<AggerateItemCategoryViewModelHandler>();
|
||||
services.AddHandler<AggregateItemCategoryViewModelHandler>();
|
||||
|
||||
services.AddTemplate<ItemNavigationViewModel, ItemNavigationView>();
|
||||
services.AddTemplate<ItemViewModel, ItemView>("Item");
|
||||
|
||||
services.AddHandler<AggerateItemContentViewModelHandler>();
|
||||
services.AddHandler<AggregateItemContentViewModelHandler>();
|
||||
|
||||
services.AddTemplate<ItemCommandHeaderViewModel, ItemCommandHeaderView>("ItemCommandHeader");
|
||||
|
||||
@@ -134,8 +134,8 @@ public partial class App : Application
|
||||
|
||||
services.AddScoped<IValueStore<Item<(Guid, string)>>, ValueStore<Item<(Guid, string)>>>();
|
||||
|
||||
services.AddHandler<ConfirmUpdateItemHandler>(nameof(Update));
|
||||
services.AddHandler<ConfirmCreateItemHandler>(nameof(Create));
|
||||
services.AddHandler<ConfirmUpdateItemHandler>(nameof(ItemState.Write));
|
||||
services.AddHandler<ConfirmCreateItemHandler>(nameof(ItemState.New));
|
||||
|
||||
services.AddHandler<ArchiveItemHandler>();
|
||||
services.AddHandler<UnarchiveItemHandler>();
|
||||
@@ -154,7 +154,7 @@ public partial class App : Application
|
||||
services.AddInitializer<LockerInitializer>();
|
||||
|
||||
services.AddTemplate<MainViewModel, MainView>("Main");
|
||||
services.AddHandler<AggerateMainViewModelHandler>();
|
||||
services.AddHandler<AggregateMainViewModelHandler>();
|
||||
|
||||
services.AddTransient<FooterViewModel>();
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
<ListBox
|
||||
x:Name="foo"
|
||||
Margin="2,-1,0,0"
|
||||
AutoScrollToSelectedItem="True"
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
|
||||
@@ -5,6 +5,14 @@ namespace Bitvault.Avalonia;
|
||||
public partial class ItemCollectionView :
|
||||
UserControl
|
||||
{
|
||||
public ItemCollectionView() =>
|
||||
public ItemCollectionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
foo.SelectionChanged += Foo_SelectionChanged;
|
||||
}
|
||||
|
||||
private void Foo_SelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<PersonPicture
|
||||
Width="144"
|
||||
Height="144"
|
||||
DisplayName="{Binding Value}" />
|
||||
DisplayName="{Binding Value, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<TextBox
|
||||
MaxWidth="360"
|
||||
Text="{Binding Value}"
|
||||
|
||||
@@ -3,40 +3,23 @@
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ItemNavigationViewModel">
|
||||
x:DataType="vm:ItemNavigationViewModel"
|
||||
ListBoxExtension.IsItemInvokedEnabled="True">
|
||||
<ListBoxItem.Resources>
|
||||
<SolidColorBrush x:Key="StarredIconForegroundBrush" Color="#FFEDB120" />
|
||||
</ListBoxItem.Resources>
|
||||
<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="State" Value="{x:Static vm:ItemState.Read}" />
|
||||
<Parameter Key="Name" Value="{Binding Name}" />
|
||||
<Parameter Key="Favourite" Value="{Binding Favourite}" />
|
||||
<Parameter Key="Archived" Value="{Binding Archived}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</AttachedBehaviour>
|
||||
<DataTriggerBehavior Binding="{Binding Selected}" Value="True">
|
||||
<AttachedEventTriggerBehaviour RoutedEvent="{x:Static ListBoxExtension.ItemInvokedEvent}">
|
||||
<NavigateAction
|
||||
Region="{Binding Named, StringFormat='{}{0}:Content'}"
|
||||
Route="Item"
|
||||
Scope="self">
|
||||
<Parameter Key="Name" Value="{Binding Name}" />
|
||||
<Parameter Key="State" Value="{x:Static vm:ItemState.Read}" />
|
||||
<Parameter Key="Name" Value="{Binding Name}" />
|
||||
<Parameter Key="Favourite" Value="{Binding Favourite}" />
|
||||
<Parameter Key="Archived" Value="{Binding Archived}" />
|
||||
</NavigateAction>
|
||||
</DataTriggerBehavior>
|
||||
</AttachedEventTriggerBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
<Grid Background="Transparent" ColumnDefinitions="Auto,*">
|
||||
<PersonPicture
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
Content="{Binding Name}"
|
||||
IsExpanded="{Binding Expanded}"
|
||||
MenuItemsSource="{Binding}"
|
||||
NavigationViewItemExtension.IsItemClickEnabled="True"
|
||||
NavigationViewExtension.IsItemInvokedEnabled="True"
|
||||
SelectsOnInvoked="True">
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding Opened}" Value="False">
|
||||
@@ -64,7 +64,7 @@
|
||||
<InvokeNavigationViewItemAction />
|
||||
</ConditionAction>
|
||||
</AttachedBehaviour>
|
||||
<AttachedEventTriggerBehaviour RoutedEvent="{x:Static NavigationViewItemExtension.ItemClickEvent}">
|
||||
<AttachedEventTriggerBehaviour RoutedEvent="{x:Static NavigationViewExtension.ItemInvokedEvent}">
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
|
||||
Reference in New Issue
Block a user