WIP
This commit is contained in:
@@ -2,16 +2,19 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class ItemMaskedTextEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
IHandler<MaskedTextEntryConfiguration, IItemEntryViewModel?>
|
||||
public class ItemMaskedTextEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
IHandler<CreateEventArgs<MaskedTextEntryConfiguration>, IItemEntryViewModel?>
|
||||
{
|
||||
public Task<IItemEntryViewModel?> Handle(MaskedTextEntryConfiguration args,
|
||||
public Task<IItemEntryViewModel?> Handle(CreateEventArgs<MaskedTextEntryConfiguration> args,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
if (serviceFactory.Create<ItemMaskedTextEntryViewModel>(args, args.Label, args.Value ?? "") is
|
||||
ItemMaskedTextEntryViewModel viewModel)
|
||||
if (args.Value is MaskedTextEntryConfiguration configuration)
|
||||
{
|
||||
return Task.FromResult<IItemEntryViewModel?>(viewModel);
|
||||
if (serviceFactory.Create<ItemMaskedTextEntryViewModel>([.. args.Parameters, configuration, configuration.Label, configuration.Value ?? ""])
|
||||
is ItemMaskedTextEntryViewModel viewModel)
|
||||
{
|
||||
return Task.FromResult<IItemEntryViewModel?>(viewModel);
|
||||
}
|
||||
}
|
||||
|
||||
return Task.FromResult<IItemEntryViewModel?>(default);
|
||||
|
||||
Reference in New Issue
Block a user