Fixed more edge cases

This commit is contained in:
TheXamlGuy
2024-05-16 21:41:48 +01:00
parent c5942045df
commit 02616a6c73
6 changed files with 19 additions and 33 deletions
+6 -5
View File
@@ -11,18 +11,19 @@ public partial class ItemHeaderViewModel(IServiceProvider provider,
IDisposer disposer,
bool immutable,
string? value = null) : ObservableViewModel<string, string>(provider, factory, mediator, publisher, subscriber, disposer, value),
IHandler<ConfirmEventArgs<Item>, bool>
IHandler<ValidationEventArgs<Item>, bool>,
IHandler<ConfirmEventArgs<Item>, ItemHeaderConfiguration>
{
[ObservableProperty]
private bool immutable = immutable;
public Task<bool> Handle(ConfirmEventArgs<Item> args,
public Task<bool> Handle(ValidationEventArgs<Item> args,
CancellationToken cancellationToken)
{
// we need to work on the local validation layer
return Task.FromResult(true);
}
public void Invoke(ItemConfiguration args) =>
args.Name = Value;
public Task<ItemHeaderConfiguration> Handle(ConfirmEventArgs<Item> args,
CancellationToken cancellationToken) => Task.FromResult(new ItemHeaderConfiguration { Name = Value });
}