20 lines
655 B
C#
20 lines
655 B
C#
using Toolkit.Foundation;
|
|
|
|
namespace Bitvault;
|
|
|
|
public class ItemPasswordEntryViewModelHandler(IServiceFactory serviceFactory) :
|
|
IHandler<PasswordEntryConfiguration, IItemEntryViewModel?>
|
|
{
|
|
public Task<IItemEntryViewModel?> Handle(PasswordEntryConfiguration args,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
if (serviceFactory.Create<ItemPasswordEntryViewModel>("Password", args.Label, args.Value ?? new object())
|
|
is ItemPasswordEntryViewModel viewModel)
|
|
{
|
|
return Task.FromResult<IItemEntryViewModel?>(viewModel);
|
|
}
|
|
|
|
return Task.FromResult<IItemEntryViewModel?>(default);
|
|
}
|
|
}
|