Fixes
This commit is contained in:
@@ -6,15 +6,4 @@ public partial class AllNavigationViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory, IMediator mediator,
|
||||
IPublisher publisher, ISubscriber subscriber, IDisposer disposer, int key, string value) :
|
||||
FilterNavigationViewModel(provider, factory, mediator, publisher, subscriber, disposer, key, value),
|
||||
INotificationHandler<NotifyEventArgs<Item<int>>>
|
||||
{
|
||||
//public Task Handle(NotifyEventArgs<Item<int>> args)
|
||||
//{
|
||||
// if (args.Sender is Item<int> item)
|
||||
// {
|
||||
// Key = item.Value;
|
||||
// }
|
||||
|
||||
// return Task.CompletedTask;
|
||||
//}
|
||||
}
|
||||
INotificationHandler<NotifyEventArgs<Item<int>>>;
|
||||
@@ -29,7 +29,7 @@ public class CreateItemViewModelHandler(IServiceFactory serviceFactory,
|
||||
|
||||
itemHeaderConfigurationDecorator.Set(configuration);
|
||||
|
||||
if (serviceFactory.Create<ItemViewModel>(args => args.OnInitialize(), args.Parameters) is ItemViewModel itemViewModel)
|
||||
if (serviceFactory.Create<ItemViewModel>(args => args.Initialize(), args.Parameters) is ItemViewModel itemViewModel)
|
||||
{
|
||||
itemViewModel.Add<ItemHeaderViewModel>(configuration, state, "", name);
|
||||
itemViewModel.Add<ItemContentViewModel>();
|
||||
|
||||
@@ -19,10 +19,10 @@ public abstract partial class FilterNavigationViewModel(IServiceProvider provide
|
||||
INotificationHandler<NotifyEventArgs<Item<int>>>
|
||||
{
|
||||
[ObservableProperty]
|
||||
private bool activated;
|
||||
private bool isActivated;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool selected;
|
||||
private bool isSelected;
|
||||
|
||||
public Task Handle(NotifyEventArgs<Item<int>> args)
|
||||
{
|
||||
@@ -35,10 +35,10 @@ public abstract partial class FilterNavigationViewModel(IServiceProvider provide
|
||||
}
|
||||
|
||||
public Task Handle(DeactivatedEventArgs<Wallet> args) =>
|
||||
Task.FromResult(Activated = false);
|
||||
Task.FromResult(IsActivated = false);
|
||||
|
||||
public Task Handle(ActivatedEventArgs<Wallet> args) =>
|
||||
Task.FromResult(Activated = true);
|
||||
Task.FromResult(IsActivated = true);
|
||||
}
|
||||
|
||||
[Notification(typeof(NotifyEventArgs<Item<int>>), nameof(Value))]
|
||||
@@ -61,7 +61,7 @@ public abstract partial class FilterNavigationViewModel<TWalletNavigation>(IServ
|
||||
private bool activated;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool selected;
|
||||
private bool isSelected;
|
||||
|
||||
public Task Handle(DeactivatedEventArgs<Wallet> args) =>
|
||||
Task.FromResult(Activated = false);
|
||||
|
||||
@@ -16,13 +16,13 @@ public partial class ItemCategoryCollectionViewModel(IServiceProvider provider,
|
||||
[ObservableProperty]
|
||||
private IContentTemplate template = template;
|
||||
|
||||
public override Task OnActivated()
|
||||
public override Task Activated()
|
||||
{
|
||||
Publisher.Publish(Notify.As(Factory.Create<WalletCommandHeaderCollection>(new List<IDisposable>
|
||||
{
|
||||
Factory.Create<BackActionViewModel>(),
|
||||
})));
|
||||
|
||||
return base.OnActivated();
|
||||
return base.Activated();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public partial class ItemCategoryNavigationViewModel(IServiceProvider provider,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer,
|
||||
string name,
|
||||
bool selected = false) :
|
||||
bool isSelected = false) :
|
||||
Observable(provider, factory, mediator, publisher, subscriber, disposer),
|
||||
ISelectable,
|
||||
IRemovable
|
||||
@@ -20,7 +20,7 @@ public partial class ItemCategoryNavigationViewModel(IServiceProvider provider,
|
||||
private string name = name;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool selected = selected;
|
||||
private bool isSelected = isSelected;
|
||||
|
||||
[RelayCommand]
|
||||
public void Invoke() => Publisher.Publish(Notify.As(new ItemCategory<string>(Name)));
|
||||
|
||||
@@ -59,7 +59,7 @@ public partial class ItemCollectionViewModel :
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task OnActivated()
|
||||
public override Task Activated()
|
||||
{
|
||||
Publisher.Publish(Notify.As(Factory.Create<WalletCommandHeaderCollection>(new List<IDisposable>
|
||||
{
|
||||
@@ -67,7 +67,7 @@ public partial class ItemCollectionViewModel :
|
||||
Factory.Create<SearchWalletActionViewModel>(),
|
||||
})));
|
||||
|
||||
return base.OnActivated();
|
||||
return base.Activated();
|
||||
}
|
||||
|
||||
protected override SynchronizeExpression BuildAggregateExpression() =>
|
||||
|
||||
@@ -15,7 +15,7 @@ public partial class ItemNavigationViewModel(IServiceProvider provider,
|
||||
string name = "",
|
||||
string description = "",
|
||||
string category = "",
|
||||
bool selected = false,
|
||||
bool isSelected = false,
|
||||
bool favourite = false,
|
||||
bool archived = false) :
|
||||
Observable(provider, factory, mediator, publisher, subscriber, disposer),
|
||||
@@ -50,7 +50,7 @@ public partial class ItemNavigationViewModel(IServiceProvider provider,
|
||||
private string named = $"{named}";
|
||||
|
||||
[ObservableProperty]
|
||||
private bool selected = selected;
|
||||
private bool isSelected = isSelected;
|
||||
|
||||
public IContentTemplate Template { get; set; } = template;
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ public partial class ItemViewModel :
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task OnActivated()
|
||||
public override Task Activated()
|
||||
{
|
||||
if (Archived)
|
||||
{
|
||||
@@ -131,7 +131,7 @@ public partial class ItemViewModel :
|
||||
}
|
||||
}
|
||||
|
||||
return base.OnActivated();
|
||||
return base.Activated();
|
||||
}
|
||||
|
||||
protected override SynchronizeExpression BuildAggregateExpression() =>
|
||||
|
||||
@@ -14,7 +14,7 @@ public class MaskedTextEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
string? value = $"{configuration.Value}" ?? "";
|
||||
double? width = configuration.Width;
|
||||
|
||||
if (serviceFactory.Create<MaskedTextEntryViewModel>(args => args.OnInitialize(),
|
||||
if (serviceFactory.Create<MaskedTextEntryViewModel>(args => args.Initialize(),
|
||||
[.. args.Parameters, configuration, configuration.Pattern, label, value, width])
|
||||
is MaskedTextEntryViewModel viewModel)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ public class MultilineTextEntryViewModelHandler(IServiceFactory serviceFactory)
|
||||
string? value = $"{configuration.Value}" ?? "";
|
||||
double? width = configuration.Width;
|
||||
|
||||
if (serviceFactory.Create<MultilineTextEntryViewModel>(args => args.OnInitialize(),
|
||||
if (serviceFactory.Create<MultilineTextEntryViewModel>(args => args.Initialize(),
|
||||
[.. args.Parameters, configuration, label, value, width])
|
||||
is MultilineTextEntryViewModel viewModel)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,6 @@ public partial class OpenWalletViewModel : Observable
|
||||
[ObservableProperty]
|
||||
private string? password;
|
||||
|
||||
|
||||
[ObservableProperty]
|
||||
private string? repeatedPassword;
|
||||
|
||||
@@ -28,7 +27,6 @@ public partial class OpenWalletViewModel : Observable
|
||||
string name) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
this.validation = validation;
|
||||
|
||||
Name = name;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public class PasswordEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
string? value = $"{configuration.Value}" ?? "";
|
||||
double? width = configuration.Width;
|
||||
|
||||
if (serviceFactory.Create<PasswordEntryViewModel>(args => args.OnInitialize(),
|
||||
if (serviceFactory.Create<PasswordEntryViewModel>(args => args.Initialize(),
|
||||
[.. args.Parameters, configuration, label, value, width])
|
||||
is PasswordEntryViewModel viewModel)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ public class PinEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
string? value = $"{configuration.Value}" ?? "";
|
||||
double? width = configuration.Width;
|
||||
|
||||
if (serviceFactory.Create<PinEntryViewModel>(args => args.OnInitialize(),
|
||||
if (serviceFactory.Create<PinEntryViewModel>(args => args.Initialize(),
|
||||
[.. args.Parameters, configuration, label, value, width])
|
||||
is PinEntryViewModel viewModel)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ public class SynchronizeCategoriesNavigationViewModelHandler(IMediator mediator,
|
||||
int count = counts?.FirstOrDefault(x => x.Name == configuration.Key).Count ?? 0;
|
||||
string name = configuration.Key;
|
||||
|
||||
if (serviceFactory.Create<CategoryNavigationViewModel>(args => args.OnInitialize(), count, name)
|
||||
if (serviceFactory.Create<CategoryNavigationViewModel>(args => args.Initialize(), count, name)
|
||||
is CategoryNavigationViewModel viewModel)
|
||||
{
|
||||
publisher.Publish(Create.As(viewModel), nameof(CategoriesNavigationViewModel));
|
||||
|
||||
@@ -12,7 +12,7 @@ public class SynchronizeItemCategoryViewModelHandler(IItemConfigurationCollectio
|
||||
bool selected = true;
|
||||
foreach (KeyValuePair<string, Func<ItemConfiguration>> configuration in configurations)
|
||||
{
|
||||
if (serviceFactory.Create<ItemCategoryNavigationViewModel>(args => args.OnInitialize(),
|
||||
if (serviceFactory.Create<ItemCategoryNavigationViewModel>(args => args.Initialize(),
|
||||
configuration.Key, selected)
|
||||
is ItemCategoryNavigationViewModel viewModel)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ public class SynchronizeItemCollectionViewModelHandler(IMediator mediator,
|
||||
IDecoratorService<Item<(Guid, string)>> decoratorService = serviceScope.ServiceProvider
|
||||
.GetRequiredService<IDecoratorService<Item<(Guid, string)>>>();
|
||||
|
||||
if (serviceFactory.Create<ItemNavigationViewModel>(args => args.OnInitialize(),
|
||||
if (serviceFactory.Create<ItemNavigationViewModel>(args => args.Initialize(),
|
||||
Id, Name, "Description", Category, selected, Favourite, Archived)
|
||||
is ItemNavigationViewModel viewModel)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ public class SynchronizeItemContentFromCategoryViewModelHandler(IItemConfigurati
|
||||
foreach (ItemSectionConfiguration configurationSection in configuration.Sections)
|
||||
{
|
||||
string id = $"{nameof(ItemSection)}:{Guid.NewGuid()}";
|
||||
if (serviceFactory.Create<ItemSectionViewModel>(args => args.OnInitialize(), id)
|
||||
if (serviceFactory.Create<ItemSectionViewModel>(args => args.Initialize(), id)
|
||||
is ItemSectionViewModel sectionViewModel)
|
||||
{
|
||||
publisher.Publish(Create.As(sectionViewModel), nameof(ItemContentViewModel));
|
||||
|
||||
@@ -25,7 +25,7 @@ public class SynchronizeItemContentViewModelHandler(IDecoratorService<Item<(Guid
|
||||
foreach (ItemSectionConfiguration configurationSection in configuration.Sections)
|
||||
{
|
||||
string id = $"{nameof(ItemSection)}:{Guid.NewGuid()}";
|
||||
if (serviceFactory.Create<ItemSectionViewModel>(args => args.OnInitialize(), id)
|
||||
if (serviceFactory.Create<ItemSectionViewModel>(args => args.Initialize(), id)
|
||||
is ItemSectionViewModel sectionViewModel)
|
||||
{
|
||||
publisher.Publish(Create.As(sectionViewModel), nameof(ItemContentViewModel));
|
||||
|
||||
@@ -19,7 +19,7 @@ public class SynchronizeMainViewModelHandler(IPublisher publisher,
|
||||
{
|
||||
if (Wallet.Services.GetRequiredService<IServiceFactory>() is IServiceFactory factory)
|
||||
{
|
||||
if (factory.Create<WalletNavigationViewModel>(args => args.OnInitialize(), descriptor.Name, selected)
|
||||
if (factory.Create<WalletNavigationViewModel>(args => args.Initialize(), descriptor.Name, selected)
|
||||
is WalletNavigationViewModel viewModel)
|
||||
{
|
||||
publisher.Publish(Create.As<IMainNavigationViewModel>(viewModel),
|
||||
|
||||
@@ -14,7 +14,7 @@ public class TextEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
string? value = $"{configuration.Value}" ?? "";
|
||||
double? width = configuration.Width;
|
||||
|
||||
if (serviceFactory.Create<TextEntryViewModel>(args => args.OnInitialize(),
|
||||
if (serviceFactory.Create<TextEntryViewModel>(args => args.Initialize(),
|
||||
[.. args.Parameters, configuration, label, value, width])
|
||||
is TextEntryViewModel viewModel)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ public class WalletActivatedHandler(IWalletHostCollection Wallets,
|
||||
{
|
||||
if (host.Services.GetRequiredService<IServiceFactory>() is IServiceFactory serviceFactory)
|
||||
{
|
||||
if (serviceFactory.Create<WalletNavigationViewModel>(args => args.OnInitialize(),
|
||||
if (serviceFactory.Create<WalletNavigationViewModel>(args => args.Initialize(),
|
||||
descriptor.Name, false)
|
||||
is WalletNavigationViewModel viewModel)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ public class WalletInitializer(IEnumerable<IConfigurationDescriptor<WalletConfig
|
||||
IWalletHostCollection Wallets) :
|
||||
IInitialization
|
||||
{
|
||||
public async Task OnInitialize()
|
||||
public async Task Initialize()
|
||||
{
|
||||
foreach (IConfigurationDescriptor<WalletConfiguration> configuration in configurations)
|
||||
{
|
||||
|
||||
@@ -13,19 +13,19 @@ public partial class WalletNavigationViewModel :
|
||||
ISelectable
|
||||
{
|
||||
[ObservableProperty]
|
||||
private bool activated;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool expanded = true;
|
||||
private bool isExpanded = true;
|
||||
|
||||
[ObservableProperty]
|
||||
private string name;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool opened;
|
||||
private bool isOpened;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool selected;
|
||||
private bool isSelected;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isActivated;
|
||||
|
||||
public WalletNavigationViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
@@ -35,11 +35,11 @@ public partial class WalletNavigationViewModel :
|
||||
IDisposer disposer,
|
||||
IContentTemplate template,
|
||||
string name,
|
||||
bool selected) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
bool isSelected) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
Template = template;
|
||||
Name = name;
|
||||
Selected = selected;
|
||||
IsSelected = isSelected;
|
||||
}
|
||||
|
||||
public IContentTemplate Template { get; set; }
|
||||
@@ -53,21 +53,21 @@ public partial class WalletNavigationViewModel :
|
||||
|
||||
Publisher.Publish(Changed.As<Item>());
|
||||
|
||||
Opened = true;
|
||||
IsOpened = true;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(ClosedEventArgs<Wallet> args)
|
||||
{
|
||||
Opened = true;
|
||||
IsOpened = true;
|
||||
Clear();
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(DeactivatedEventArgs<Wallet> args) =>
|
||||
Task.FromResult(Activated = false);
|
||||
Task.FromResult(IsActivated = false);
|
||||
|
||||
public Task Handle(ActivatedEventArgs<Wallet> args) =>
|
||||
Task.FromResult(Activated = true);
|
||||
Task.FromResult(IsActivated = true);
|
||||
}
|
||||
@@ -25,15 +25,15 @@ public partial class WalletViewModel :
|
||||
Filter = filter;
|
||||
}
|
||||
|
||||
public override async Task OnActivated()
|
||||
public override async Task Activated()
|
||||
{
|
||||
Publisher.Publish(Activated.As<Wallet>());
|
||||
await base.OnActivated();
|
||||
Publisher.Publish(Toolkit.Foundation.Activated.As<Wallet>());
|
||||
await base.Activated();
|
||||
}
|
||||
|
||||
public override async Task OnDeactivated()
|
||||
public override async Task Deactivated()
|
||||
{
|
||||
Publisher.Publish(Deactivated.As<Wallet>());
|
||||
await base.OnDeactivated();
|
||||
Publisher.Publish(Toolkit.Foundation.Deactivated.As<Wallet>());
|
||||
await base.Deactivated();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user