diff --git a/Wallet/ItemCreatedHandler.cs b/Wallet/ItemCreatedHandler.cs index 3ac2fd1..9612064 100644 --- a/Wallet/ItemCreatedHandler.cs +++ b/Wallet/ItemCreatedHandler.cs @@ -18,7 +18,7 @@ public class ItemCreatedHandler(IServiceProvider serviceProvider, IServiceFactory serviceFactory = serviceScope.ServiceProvider.GetRequiredService(); IDecoratorService> decoratorService = serviceScope.ServiceProvider.GetRequiredService>>(); - if (serviceFactory.Create(args => args.Initialize(), + if (serviceFactory.Create(args => args.Initialize(), "All", id, name, "Description", category, true) is ItemNavigationViewModel viewModel) { diff --git a/Wallet/ItemNavigationCollectionViewModel.cs b/Wallet/ItemNavigationCollectionViewModel.cs index 3e90660..fddd541 100644 --- a/Wallet/ItemNavigationCollectionViewModel.cs +++ b/Wallet/ItemNavigationCollectionViewModel.cs @@ -3,9 +3,9 @@ using Toolkit.Foundation; namespace Wallet; -[Notification(typeof(CreateEventArgs), nameof(ItemNavigationCollectionViewModel))] -[Notification(typeof(InsertEventArgs), nameof(ItemNavigationCollectionViewModel))] -[Notification(typeof(MoveToEventArgs), nameof(ItemNavigationCollectionViewModel))] +[Notification(typeof(CreateEventArgs), nameof(Filter))] +[Notification(typeof(InsertEventArgs), nameof(Filter))] +[Notification(typeof(MoveToEventArgs), nameof(Filter))] [Notification(typeof(NotifyEventArgs>), nameof(ItemNavigationCollectionViewModel))] public partial class ItemNavigationCollectionViewModel : ObservableCollection, @@ -31,10 +31,14 @@ public partial class ItemNavigationCollectionViewModel : { Template = template; Named = $"{named}"; + Filter = filter; this.configuration = configuration with { Filter = filter }; } + [ObservableProperty] + private string? filter; + public IContentTemplate Template { get; set; } public Task Handle(NotifyEventArgs args) diff --git a/Wallet/ItemNavigationCollectionViewModelActivatedHandler.cs b/Wallet/ItemNavigationCollectionViewModelActivatedHandler.cs index 0a4c5d5..6bf82f4 100644 --- a/Wallet/ItemNavigationCollectionViewModelActivatedHandler.cs +++ b/Wallet/ItemNavigationCollectionViewModelActivatedHandler.cs @@ -40,7 +40,7 @@ public class ItemNavigationCollectionViewModelActivatedHandler(IMediator mediato decoratorService.Set(item); cache.Add(item); - publisher.Publish(Create.As(viewModel), nameof(ItemNavigationCollectionViewModel)); + publisher.Publish(Create.As(viewModel), configuration.Filter); } selected = false;