tidy up ui
This commit is contained in:
@@ -798,11 +798,12 @@ public record ItemConfiguration
|
||||
{
|
||||
Entries = new List<ItemEntryConfiguration>
|
||||
{
|
||||
new TextEntryConfiguration
|
||||
{
|
||||
Label = "Pin"
|
||||
},
|
||||
new PinEntryConfiguration
|
||||
{
|
||||
Label = "Pin",
|
||||
Maximum = 4
|
||||
},
|
||||
new TextEntryConfiguration
|
||||
{
|
||||
Label = "Credit Limit",
|
||||
},
|
||||
|
||||
@@ -11,7 +11,7 @@ public class MaskedTextEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
if (args.Sender is MaskedTextEntryConfiguration configuration)
|
||||
{
|
||||
string? label = configuration.Label;
|
||||
object? value = configuration.Value ?? "";
|
||||
string? value = $"{configuration.Value}" ?? "";
|
||||
double? width = configuration.Width;
|
||||
|
||||
if (serviceFactory.Create<MaskedTextEntryViewModel>([.. args.Parameters, configuration, configuration.Pattern, label, value, width])
|
||||
|
||||
@@ -7,4 +7,3 @@ public record PinEntryConfiguration :
|
||||
|
||||
public int Maximum { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public partial class PinEntryViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
ItemState state,
|
||||
ItemEntryConfiguration configuration,
|
||||
string key,
|
||||
string value,
|
||||
double width) : ItemEntryViewModel<string>(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, width);
|
||||
@@ -0,0 +1,26 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public class PinEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
IHandler<CreateEventArgs<PinEntryConfiguration>, IItemEntryViewModel?>
|
||||
{
|
||||
public Task<IItemEntryViewModel?> Handle(CreateEventArgs<PinEntryConfiguration> args,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
if (args.Sender is PinEntryConfiguration configuration)
|
||||
{
|
||||
string? label = configuration.Label;
|
||||
string? value = $"{configuration.Value}" ?? "";
|
||||
double? width = configuration.Width;
|
||||
|
||||
if (serviceFactory.Create<PinEntryViewModel>([.. args.Parameters, configuration, label, value, width])
|
||||
is PinEntryViewModel viewModel)
|
||||
{
|
||||
return Task.FromResult<IItemEntryViewModel?>(viewModel);
|
||||
}
|
||||
}
|
||||
|
||||
return Task.FromResult<IItemEntryViewModel?>(default);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user