Parameter improvements
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class AddItemContentNavigationView : UserControl
|
||||
{
|
||||
public AddItemContentNavigationView() => InitializeComponent();
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.AddItemContentNavigationView"
|
||||
x:Class="Bitvault.Avalonia.AddItemNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SettingsExpander Header="Add item" IsClickEnabled="True" />
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class AddItemNavigationView : UserControl
|
||||
{
|
||||
public AddItemNavigationView() => InitializeComponent();
|
||||
}
|
||||
@@ -15,9 +15,7 @@
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Main" Route="Container">
|
||||
<NavigateAction.ParameterBindings>
|
||||
<ParameterBinding Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction.ParameterBindings>
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
<ConditionAction>
|
||||
@@ -26,7 +24,10 @@
|
||||
<ComparisonCondition LeftOperand="{Binding Activated}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<InvokeCommandAction Command="{Binding InvokeCommand}" />
|
||||
<NavigateAction Region="Left" Route="ContentItemCollection">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
<Parameter Key="Transition" Value="FromRight" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
|
||||
@@ -87,11 +87,15 @@ public partial class App : Application
|
||||
services.AddScoped<ContainerViewModelConfiguration>();
|
||||
|
||||
services.AddTemplate<ContainerViewModel, ContainerView>("Container");
|
||||
services.AddHandler<AggerateContainerViewModelHandler>();
|
||||
services.AddTemplate<ContainerItemCollectionViewModel, ContainerItemCollectionView>("ContentItemCollection");
|
||||
|
||||
services.AddTemplate<SearchContainerActionViewModel, SearchContainerActionView>();
|
||||
services.AddTemplate<ContainerHeaderViewModel, ContainerHeaderView>("ContainerHeader");
|
||||
|
||||
services.AddTemplate<CreateItemActionViewModel, CreateItemActionView>();
|
||||
services.AddTemplate<ContainerCategoryCollectionViewModel, ContainerCategoryCollectionView>("ContainerItemCategoryCollection");
|
||||
|
||||
services.AddHandler<AggerateContainerItemViewModelHandler>();
|
||||
|
||||
services.AddTemplate<ItemNavigationViewModel, ItemNavigationView>();
|
||||
services.AddTemplate<ItemViewModel, ItemView>("Item");
|
||||
@@ -109,7 +113,7 @@ public partial class App : Application
|
||||
|
||||
services.AddTemplate<ItemHeaderViewModel, ItemHeaderView>();
|
||||
services.AddTemplate<ItemContentViewModel, ItemContentView>();
|
||||
services.AddTemplate<AddItemContentNavigationViewModel, AddItemContentNavigationView>();
|
||||
services.AddTemplate<AddItemNavigationViewModel, AddItemNavigationView>();
|
||||
|
||||
services.AddScoped<IValueStore<Item>, ValueStore<Item>>();
|
||||
|
||||
|
||||
@@ -15,10 +15,8 @@
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Main" Route="Container">
|
||||
<NavigateAction.ParameterBindings>
|
||||
<ParameterBinding Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction.ParameterBindings>
|
||||
</NavigateAction>
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
@@ -26,7 +24,9 @@
|
||||
<ComparisonCondition LeftOperand="{Binding Activated}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<InvokeCommandAction Command="{Binding InvokeCommand}" />
|
||||
<NavigateAction Region="Left" Route="ContentItemCollection">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
|
||||
@@ -40,8 +40,14 @@
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.UI.Controls.Avalonia\Toolkit.UI.Controls.Avalonia.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="AddItemContentNavigationViewModel.axaml.cs">
|
||||
<DependentUpon>AddItemContentNavigationViewModel.axaml</DependentUpon>
|
||||
<Compile Update="AddItemNavigationView.axaml.cs">
|
||||
<DependentUpon>AddItemNavigationView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ContainerCategoryCollectionView.axaml.cs">
|
||||
<DependentUpon>ContainerCategoryCollectionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ContainerItemCollectionView.axaml.cs">
|
||||
<DependentUpon>ContainerItemCollectionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="CreateItemActionView.axaml.cs">
|
||||
<DependentUpon>CreateItemActionView.axaml</DependentUpon>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.ContainerCategoryCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ContainerCategoryCollectionViewModel">
|
||||
<ListBox
|
||||
Margin="2,-1,0,0"
|
||||
AutoScrollToSelectedItem="True"
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
ItemsSource="{Binding}"
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<ListBox.Styles>
|
||||
<Style Selector="ListBoxItem">
|
||||
<Setter Property="IsSelected" Value="{ReflectionBinding Selected, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</ListBox.Styles>
|
||||
</ListBox>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using Avalonia.Controls;
|
||||
using FluentAvalonia.UI.Media.Animation;
|
||||
using Toolkit.UI.Avalonia;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class ContainerCategoryCollectionView :
|
||||
UserControl
|
||||
{
|
||||
public ContainerCategoryCollectionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.ContainerItemCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ContainerItemCollectionViewModel">
|
||||
<ListBox
|
||||
Margin="2,-1,0,0"
|
||||
AutoScrollToSelectedItem="True"
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
ItemsSource="{Binding}"
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<ListBox.Styles>
|
||||
<Style Selector="ListBoxItem">
|
||||
<Setter Property="IsSelected" Value="{ReflectionBinding Selected, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</ListBox.Styles>
|
||||
</ListBox>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class ContainerItemCollectionView :
|
||||
UserControl
|
||||
{
|
||||
public ContainerItemCollectionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -22,21 +22,17 @@
|
||||
</Interaction.Behaviors>
|
||||
</ContentControl>
|
||||
</Grid>
|
||||
<ListBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="2,-1,0,0"
|
||||
AutoScrollToSelectedItem="True"
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
ItemsSource="{Binding}"
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<ListBox.Styles>
|
||||
<Style Selector="ListBoxItem">
|
||||
<Setter Property="IsSelected" Value="{ReflectionBinding Selected, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</ListBox.Styles>
|
||||
</ListBox>
|
||||
<Frame Grid.Row="1" Grid.Column="0">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<NavigateRegionAction Name="Left">
|
||||
<NavigateAction Region="Left" Route="ContentItemCollection">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction>
|
||||
</NavigateRegionAction>
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</Frame>
|
||||
<GridSplitter
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
@@ -64,7 +60,7 @@
|
||||
</Interaction.Behaviors>
|
||||
</ContentControl>
|
||||
</Border>
|
||||
<ContentControl x:Name="Content" Grid.Row="1">
|
||||
<ContentControl Grid.Row="1">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<NavigateRegionAction Name="{Binding Named, StringFormat='{}{0}:Content'}" />
|
||||
|
||||
@@ -28,14 +28,9 @@
|
||||
</Grid>
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Click">
|
||||
<NavigateAction
|
||||
Region="{Binding Named, StringFormat='{}{0}:Content'}"
|
||||
Route="Item"
|
||||
Scope="new">
|
||||
<NavigateAction.ParameterBindings>
|
||||
<ParameterBinding Key="Immutable" Value="{x:False}" />
|
||||
</NavigateAction.ParameterBindings>
|
||||
</NavigateAction>
|
||||
<NavigateAction Region="Left" Route="ContainerItemCategoryCollection">
|
||||
<Parameter Key="Transition" Value="FromRight" />
|
||||
</NavigateAction>
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</Button>
|
||||
|
||||
@@ -20,12 +20,10 @@
|
||||
Region="{Binding Named, StringFormat='{}{0}:Content'}"
|
||||
Route="Item"
|
||||
Scope="self">
|
||||
<NavigateAction.ParameterBindings>
|
||||
<ParameterBinding Key="Name" Value="{Binding Name}" />
|
||||
<ParameterBinding Key="Immutable" Value="{x:True}" />
|
||||
<ParameterBinding Key="Archived" Value="{Binding Archived}" />
|
||||
<ParameterBinding Key="Favourite" Value="{Binding Favourite}" />
|
||||
</NavigateAction.ParameterBindings>
|
||||
<Parameter Key="Name" Value="{Binding Name}" />
|
||||
<Parameter Key="Immutable" Value="{x:True}" />
|
||||
<Parameter Key="Archived" Value="{Binding Archived}" />
|
||||
<Parameter Key="Favourite" Value="{Binding Favourite}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</AttachedBehaviour>
|
||||
@@ -34,12 +32,10 @@
|
||||
Region="{Binding Named, StringFormat='{}{0}:Content'}"
|
||||
Route="Item"
|
||||
Scope="self">
|
||||
<NavigateAction.ParameterBindings>
|
||||
<ParameterBinding Key="Name" Value="{Binding Name}" />
|
||||
<ParameterBinding Key="Immutable" Value="{x:True}" />
|
||||
<ParameterBinding Key="Archived" Value="{Binding Archived}" />
|
||||
<ParameterBinding Key="Favourite" Value="{Binding Favourite}" />
|
||||
</NavigateAction.ParameterBindings>
|
||||
<Parameter Key="Name" Value="{Binding Name}" />
|
||||
<Parameter Key="Immutable" Value="{x:True}" />
|
||||
<Parameter Key="Archived" Value="{Binding Archived}" />
|
||||
<Parameter Key="Favourite" Value="{Binding Favourite}" />
|
||||
</NavigateAction>
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
|
||||
@@ -15,9 +15,7 @@
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Main" Route="Container">
|
||||
<NavigateAction.ParameterBindings>
|
||||
<ParameterBinding Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction.ParameterBindings>
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
<ConditionAction>
|
||||
@@ -26,7 +24,9 @@
|
||||
<ComparisonCondition LeftOperand="{Binding Activated}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<InvokeCommandAction Command="{Binding InvokeCommand}" />
|
||||
<NavigateAction Region="Left" Route="ContentItemCollection">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class AddItemContentNavigationViewModel : Observable,
|
||||
IItemEntryViewModel
|
||||
{
|
||||
public AddItemContentNavigationViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class AddItemNavigationViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer) : Observable(provider, factory, mediator, publisher, subscriber, disposer),
|
||||
IItemEntryViewModel;
|
||||
@@ -0,0 +1,21 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class AggerateContainerCategoryViewModelHandler(IServiceFactory serviceFactory,
|
||||
IPublisher publisher) :
|
||||
INotificationHandler<AggerateEventArgs<ItemNavigationViewModel,
|
||||
ContainerViewModelConfiguration>>
|
||||
{
|
||||
public Task Handle(AggerateEventArgs<ItemNavigationViewModel,
|
||||
ContainerViewModelConfiguration> args)
|
||||
{
|
||||
if (serviceFactory.Create<ItemNavigationViewModel>()
|
||||
is ItemNavigationViewModel viewModel)
|
||||
{
|
||||
publisher.Publish(Create.As(viewModel), nameof(ContainerCategoryCollectionViewModel));
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -3,11 +3,12 @@ using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class AggerateContainerViewModelHandler(IMediator mediator,
|
||||
public class AggerateContainerItemViewModelHandler(IMediator mediator,
|
||||
IServiceProvider serviceProvider,
|
||||
ICache<Item> cache,
|
||||
IPublisher publisher) :
|
||||
INotificationHandler<AggerateEventArgs<ItemNavigationViewModel, ContainerViewModelConfiguration>>
|
||||
INotificationHandler<AggerateEventArgs<ItemNavigationViewModel,
|
||||
ContainerViewModelConfiguration>>
|
||||
{
|
||||
public async Task Handle(AggerateEventArgs<ItemNavigationViewModel,
|
||||
ContainerViewModelConfiguration> args)
|
||||
@@ -15,7 +16,6 @@ public class AggerateContainerViewModelHandler(IMediator mediator,
|
||||
if (args.Options is ContainerViewModelConfiguration configuration)
|
||||
{
|
||||
cache.Clear();
|
||||
var dd = cache;
|
||||
bool selected = true;
|
||||
|
||||
if (await mediator.Handle<RequestEventArgs<QueryContainerConfiguration>,
|
||||
@@ -37,7 +37,7 @@ public class AggerateContainerViewModelHandler(IMediator mediator,
|
||||
valueStore.Set(item);
|
||||
|
||||
cache.Add(item);
|
||||
publisher.Publish(Create.As(viewModel), nameof(ContainerViewModel));
|
||||
publisher.Publish(Create.As(viewModel), nameof(ContainerItemCollectionViewModel));
|
||||
}
|
||||
|
||||
selected = false;
|
||||
@@ -2,10 +2,7 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class CommandCollection :
|
||||
ReadOnlyCollection<IDisposable>
|
||||
public class CommandCollection(IList<IDisposable> list) :
|
||||
ReadOnlyCollection<IDisposable>(list)
|
||||
{
|
||||
public CommandCollection(IList<IDisposable> list) : base(list)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
[Aggerate(nameof(ContainerCategoryCollectionViewModel))]
|
||||
public partial class ContainerCategoryCollectionViewModel :
|
||||
ObservableCollection<ItemNavigationViewModel>
|
||||
{
|
||||
public ContainerCategoryCollectionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
[Aggerate(nameof(ContainerItemCollectionViewModel))]
|
||||
public partial class ContainerItemCollectionViewModel :
|
||||
ObservableCollection<ItemNavigationViewModel>,
|
||||
INotificationHandler<NotifyEventArgs<Filter>>,
|
||||
INotificationHandler<NotifyEventArgs<Search>>
|
||||
{
|
||||
private ContainerViewModelConfiguration configuration;
|
||||
|
||||
public ContainerItemCollectionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
IContentTemplate template,
|
||||
ContainerViewModelConfiguration configuration,
|
||||
string? filter = null) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
Template = template;
|
||||
this.configuration = configuration with { Filter = filter };
|
||||
}
|
||||
|
||||
public IContentTemplate Template { get; set; }
|
||||
|
||||
public Task Handle(NotifyEventArgs<Filter> args)
|
||||
{
|
||||
if (args.Value is Filter filter)
|
||||
{
|
||||
configuration = configuration with { Filter = filter.Value };
|
||||
BeginAggregation();
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(NotifyEventArgs<Search> args)
|
||||
{
|
||||
if (args.Value is Search search)
|
||||
{
|
||||
configuration = configuration with { Query = search.Value };
|
||||
BeginAggregation();
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
protected override IAggerate OnPrepareAggregation(object? key) =>
|
||||
Aggerate.With<ItemNavigationViewModel, ContainerViewModelConfiguration>(configuration)
|
||||
with { Key = key };
|
||||
}
|
||||
@@ -3,55 +3,25 @@ using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
[Aggerate(nameof(ContainerViewModel))]
|
||||
public partial class ContainerViewModel : ObservableCollection<ItemNavigationViewModel>,
|
||||
INotificationHandler<NotifyEventArgs<Filter>>,
|
||||
INotificationHandler<NotifyEventArgs<Search>>
|
||||
public partial class ContainerViewModel :
|
||||
Observable
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string named;
|
||||
|
||||
[ObservableProperty]
|
||||
private string filter;
|
||||
public ContainerViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
IContentTemplate template,
|
||||
ContainerViewModelConfiguration configuration,
|
||||
NamedComponent named,
|
||||
string? filter = null) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
string filter) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
Template = template;
|
||||
Named = $"{named}";
|
||||
|
||||
this.configuration = configuration with { Filter = filter };
|
||||
}
|
||||
|
||||
private ContainerViewModelConfiguration configuration;
|
||||
|
||||
public IContentTemplate Template { get; set; }
|
||||
|
||||
public Task Handle(NotifyEventArgs<Filter> args)
|
||||
{
|
||||
if (args.Value is Filter filter)
|
||||
{
|
||||
configuration = configuration with { Filter = filter.Value };
|
||||
BeginAggregation();
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(NotifyEventArgs<Search> args)
|
||||
{
|
||||
if (args.Value is Search search)
|
||||
{
|
||||
configuration = configuration with { Query = search.Value };
|
||||
BeginAggregation();
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
Filter = filter;
|
||||
}
|
||||
|
||||
public override async Task OnActivated()
|
||||
@@ -65,6 +35,4 @@ public partial class ContainerViewModel : ObservableCollection<ItemNavigationVie
|
||||
Publisher.Publish(Deactivated.As<Container>());
|
||||
await base.OnDeactivated();
|
||||
}
|
||||
protected override IAggerate OnPrepareAggregation(object? key) =>
|
||||
Aggerate.With<ItemNavigationViewModel, ContainerViewModelConfiguration>(configuration) with { Key = key };
|
||||
}
|
||||
@@ -37,5 +37,5 @@ public partial class FilterContainerNavigationViewModel : Observable,
|
||||
|
||||
[RelayCommand]
|
||||
public void Invoke() => Publisher.Publish(Notify.As(new Filter(Filter)),
|
||||
nameof(ContainerViewModel));
|
||||
nameof(ContainerItemCollectionViewModel));
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public partial class ItemContentViewModel :
|
||||
|
||||
if (!immutable)
|
||||
{
|
||||
Insert<AddItemContentNavigationViewModel>();
|
||||
Insert<AddItemNavigationViewModel>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@ public partial class ItemHeaderViewModel : Observable<string, string>,
|
||||
private bool immutable;
|
||||
|
||||
public ItemHeaderViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
bool immutable,
|
||||
string? value = null) : base(provider, factory, mediator, publisher, subscriber, disposer, value)
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
bool immutable,
|
||||
string? value = null) : base(provider, factory, mediator, publisher, subscriber, disposer, value)
|
||||
{
|
||||
Immutable = immutable;
|
||||
Value = value;
|
||||
|
||||
@@ -17,5 +17,5 @@ public partial class SearchContainerActionViewModel(IServiceProvider provider,
|
||||
|
||||
[RelayCommand]
|
||||
public void Invoke() => Publisher.Publish(Notify.As(new Search(Value)),
|
||||
nameof(ContainerViewModel));
|
||||
nameof(ContainerItemCollectionViewModel));
|
||||
}
|
||||
Reference in New Issue
Block a user