Improve sub navigations
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class BackActionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer) : Observable<string>(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
[ObservableProperty]
|
||||
private int index = 0;
|
||||
|
||||
[RelayCommand]
|
||||
public void Invoke() => Publisher.Publish(Notify.As(new Search(Value)),
|
||||
nameof(ItemCollectionViewModel));
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public partial class ItemCategoryCollectionViewModel(IServiceProvider provider,
|
||||
{
|
||||
Publisher.Publish(Notify.As(Factory.Create<LockerCommandHeaderCollection>(new List<IDisposable>
|
||||
{
|
||||
|
||||
Factory.Create<BackActionViewModel>(),
|
||||
})));
|
||||
|
||||
return base.OnActivated();
|
||||
|
||||
@@ -9,9 +9,20 @@ public partial class ItemCategoryNavigationViewModel(IServiceProvider provider,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
string name) :
|
||||
Observable(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
NamedComponent named,
|
||||
string name,
|
||||
bool selected = false) :
|
||||
Observable(provider, factory, mediator, publisher, subscriber, disposer),
|
||||
ISelectable,
|
||||
IRemovable
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string name = name;
|
||||
|
||||
[ObservableProperty]
|
||||
private string named = $"{named}";
|
||||
|
||||
[ObservableProperty]
|
||||
private bool selected = selected;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@ namespace Bitvault;
|
||||
public partial class ItemCollectionViewModel :
|
||||
ObservableCollection<ItemNavigationViewModel>,
|
||||
INotificationHandler<NotifyEventArgs<Filter>>,
|
||||
INotificationHandler<NotifyEventArgs<Search>>
|
||||
INotificationHandler<NotifyEventArgs<Search>>,
|
||||
IBackStack
|
||||
{
|
||||
private LockerViewModelConfiguration configuration;
|
||||
|
||||
|
||||
@@ -14,21 +14,6 @@ public partial class SearchLockerActionViewModel(IServiceProvider provider,
|
||||
[ObservableProperty]
|
||||
private int index = 2;
|
||||
|
||||
[RelayCommand]
|
||||
public void Invoke() => Publisher.Publish(Notify.As(new Search(Value)),
|
||||
nameof(ItemCollectionViewModel));
|
||||
}
|
||||
|
||||
public partial class BackContainerActionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer) : Observable<string>(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
[ObservableProperty]
|
||||
private int index = 2;
|
||||
|
||||
[RelayCommand]
|
||||
public void Invoke() => Publisher.Publish(Notify.As(new Search(Value)),
|
||||
nameof(ItemCollectionViewModel));
|
||||
|
||||
Reference in New Issue
Block a user