More bug fixes
This commit is contained in:
@@ -10,7 +10,7 @@ public partial class CreateItemNavigationViewModel(IServiceProvider provider,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer,
|
||||
NamedComponent named) : Observable(provider, factory, mediator, publisher, subscriber, disposer),
|
||||
IWalletNavigationViewModel
|
||||
INavigationViewModel
|
||||
{
|
||||
[ObservableProperty]
|
||||
private bool isSelected;
|
||||
|
||||
@@ -9,4 +9,4 @@ public partial class CreateWalletNavigationViewModel(IServiceProvider provider,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) :
|
||||
Observable(provider, factory, mediator, publisher, subscriber, disposer),
|
||||
IMainNavigationViewModel;
|
||||
INavigationViewModel;
|
||||
@@ -12,8 +12,8 @@ public abstract partial class FilterNavigationViewModel(IServiceProvider provide
|
||||
IDisposer disposer,
|
||||
int key,
|
||||
string value) :
|
||||
ObservableCollection<IWalletNavigationViewModel, int, string>(provider, factory, mediator, publisher, subscriber, disposer, key, value),
|
||||
IWalletNavigationViewModel,
|
||||
ObservableCollection<INavigationViewModel, int, string>(provider, factory, mediator, publisher, subscriber, disposer, key, value),
|
||||
INavigationViewModel,
|
||||
INotificationHandler<ActivatedEventArgs<Wallet>>,
|
||||
INotificationHandler<DeactivatedEventArgs<Wallet>>,
|
||||
INotificationHandler<NotifyEventArgs<Item<int>>>
|
||||
@@ -38,6 +38,7 @@ public abstract partial class FilterNavigationViewModel(IServiceProvider provide
|
||||
{
|
||||
IsSelected = false;
|
||||
IsActivated = false;
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
@@ -58,11 +59,11 @@ public abstract partial class FilterNavigationViewModel<TWalletNavigation>(IServ
|
||||
int key,
|
||||
string value) :
|
||||
ObservableCollection<TWalletNavigation, int, string>(provider, factory, mediator, publisher, subscriber, disposer, key, value),
|
||||
IWalletNavigationViewModel,
|
||||
INavigationViewModel,
|
||||
INotificationHandler<ActivatedEventArgs<Wallet>>,
|
||||
INotificationHandler<DeactivatedEventArgs<Wallet>>
|
||||
where TWalletNavigation :
|
||||
IWalletNavigationViewModel
|
||||
INavigationViewModel
|
||||
{
|
||||
[ObservableProperty]
|
||||
private bool isActivated;
|
||||
@@ -74,6 +75,7 @@ public abstract partial class FilterNavigationViewModel<TWalletNavigation>(IServ
|
||||
{
|
||||
IsSelected = false;
|
||||
IsActivated = false;
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Wallet;
|
||||
|
||||
public partial class FooterViewModel :
|
||||
ObservableCollection<IMainNavigationViewModel>
|
||||
ObservableCollection<INavigationViewModel>
|
||||
{
|
||||
public FooterViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Wallet;
|
||||
|
||||
public interface IMainNavigationViewModel : IDisposable;
|
||||
@@ -0,0 +1,4 @@
|
||||
namespace Wallet;
|
||||
|
||||
public interface INavigationViewModel :
|
||||
IDisposable;
|
||||
@@ -1,7 +1,7 @@
|
||||
using Toolkit.Foundation;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public interface IWalletNavigationViewModel :
|
||||
ISelectable,
|
||||
IDisposable;
|
||||
INavigationViewModel;
|
||||
@@ -18,7 +18,7 @@ public partial class ItemCommandHeaderViewModel(IServiceProvider provider,
|
||||
{
|
||||
if (args.Sender is ItemCommandHeaderCollection commandCollection)
|
||||
{
|
||||
Clear(args =>
|
||||
Reset(args =>
|
||||
{
|
||||
foreach (IDisposable command in commandCollection)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ using Toolkit.Foundation;
|
||||
namespace Wallet;
|
||||
|
||||
public partial class MainViewModel :
|
||||
ObservableCollection<IMainNavigationViewModel>,
|
||||
ObservableCollection<INavigationViewModel>,
|
||||
INotificationHandler<SelectionEventArgs<IWalletNavigationViewModel>>
|
||||
{
|
||||
[ObservableProperty]
|
||||
@@ -27,9 +27,14 @@ public partial class MainViewModel :
|
||||
|
||||
public Task Handle(SelectionEventArgs<IWalletNavigationViewModel> args)
|
||||
{
|
||||
if (args.Sender is not null)
|
||||
if (args.Sender is WalletNavigationViewModel wallet)
|
||||
{
|
||||
SelectedItem = null;
|
||||
Reset(args => args.SetSource(wallet), false);
|
||||
SelectedItem = wallet;
|
||||
}
|
||||
else
|
||||
{
|
||||
Clear(false);
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
||||
@@ -10,7 +10,7 @@ public partial class ManageNavigationViewModel(IServiceProvider provider,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) :
|
||||
Observable(provider, factory, mediator, publisher, subscriber, disposer),
|
||||
IMainNavigationViewModel,
|
||||
INavigationViewModel,
|
||||
ISelectable
|
||||
{
|
||||
[ObservableProperty]
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Wallet;
|
||||
|
||||
public partial class ManageViewModel :
|
||||
ObservableCollection,
|
||||
IMainNavigationViewModel
|
||||
INavigationViewModel
|
||||
{
|
||||
public ManageViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
|
||||
@@ -50,17 +50,4 @@ public partial class OpenWalletViewModel :
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//public override async Task OnActivated()
|
||||
//{
|
||||
// Publisher.Publish(Activated.As<Wallet>());
|
||||
// await base.OnActivated();
|
||||
//}
|
||||
|
||||
//public override async Task OnDeactivated()
|
||||
//{
|
||||
// Publisher.Publish(Deactivated.As<Wallet>());
|
||||
// await base.OnDeactivated();
|
||||
//}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace Wallet;
|
||||
[Notification(typeof(InsertEventArgs<IWalletNavigationViewModel>), nameof(WalletNavigationCollectionViewModel))]
|
||||
public partial class WalletNavigationCollectionViewModel :
|
||||
ObservableCollection<IWalletNavigationViewModel>,
|
||||
INotificationHandler<SelectionEventArgs<IMainNavigationViewModel>>
|
||||
INotificationHandler<SelectionEventArgs<INavigationViewModel>>
|
||||
{
|
||||
public WalletNavigationCollectionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
@@ -21,9 +21,9 @@ public partial class WalletNavigationCollectionViewModel :
|
||||
|
||||
public IContentTemplate Template { get; set; }
|
||||
|
||||
public Task Handle(SelectionEventArgs<IMainNavigationViewModel> args)
|
||||
public Task Handle(SelectionEventArgs<INavigationViewModel> args)
|
||||
{
|
||||
if (args.Sender is not null)
|
||||
if (args.Sender is ManageNavigationViewModel)
|
||||
{
|
||||
SelectedItem = null;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ using Toolkit.Foundation;
|
||||
namespace Wallet;
|
||||
|
||||
public partial class WalletNavigationViewModel :
|
||||
ObservableCollection<IWalletNavigationViewModel>,
|
||||
ObservableCollection<INavigationViewModel>,
|
||||
IWalletNavigationViewModel,
|
||||
INotificationHandler<OpenedEventArgs<Wallet>>,
|
||||
INotificationHandler<ClosedEventArgs<Wallet>>,
|
||||
@@ -52,14 +52,13 @@ public partial class WalletNavigationViewModel :
|
||||
|
||||
public Task Handle(OpenedEventArgs<Wallet> args)
|
||||
{
|
||||
//Add<CreateItemNavigationViewModel>();
|
||||
//Add<AllNavigationViewModel>("All", 0);
|
||||
//Add<FavouritesNavigationViewModel>("Favourites", 0);
|
||||
//Add<ArchiveNavigationViewModel>("Archive", 0);
|
||||
//Add<CategoriesNavigationViewModel>("Categories", 0);
|
||||
Add<CreateItemNavigationViewModel>();
|
||||
Add<AllNavigationViewModel>("All", 0);
|
||||
Add<FavouritesNavigationViewModel>("Favourites", 0);
|
||||
Add<ArchiveNavigationViewModel>("Archive", 0);
|
||||
Add<CategoriesNavigationViewModel>("Categories", 0);
|
||||
|
||||
IsOpened = true;
|
||||
Publisher.Publish(Changed.As<Item>());
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user