Initial support for masking
This commit is contained in:
@@ -10,7 +10,18 @@ public class ItemDropdownEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
{
|
||||
if (args.Value is DropdownEntryConfiguration configuration)
|
||||
{
|
||||
if (serviceFactory.Create<ItemDropdownEntryViewModel>([.. args.Parameters, configuration, configuration.Label, configuration.Value ?? ""])
|
||||
List<ItemDropdownValueViewModel> values = [];
|
||||
foreach (string item in configuration.Values)
|
||||
{
|
||||
values.Add(serviceFactory.Create<ItemDropdownValueViewModel>(item));
|
||||
}
|
||||
|
||||
string? label = configuration.Label;
|
||||
object? value = configuration.Value;
|
||||
|
||||
ItemDropdownValueViewModel? selected = values.FirstOrDefault(x => x.Value is not null && x.Value.Equals($"{value}"));
|
||||
|
||||
if (serviceFactory.Create<ItemDropdownEntryViewModel>([values, .. args.Parameters, configuration, label, value ?? "", selected])
|
||||
is ItemDropdownEntryViewModel viewModel)
|
||||
{
|
||||
return Task.FromResult<IItemEntryViewModel?>(viewModel);
|
||||
|
||||
Reference in New Issue
Block a user