Allow the Mediator to be subscribed to and therefore handled

This commit is contained in:
TheXamlGuy
2024-05-15 19:28:07 +01:00
parent 98896267dc
commit 2c14001c26
7 changed files with 100 additions and 95 deletions
+8 -1
View File
@@ -11,11 +11,18 @@ public partial class ItemHeaderViewModel(IServiceProvider provider,
IDisposer disposer,
bool immutable,
string? value = null) : ObservableViewModel<string, string>(provider, factory, mediator, publisher, subscriber, disposer, value),
IItemViewModel
IHandler<ConfirmEventArgs<Item>, bool>
{
[ObservableProperty]
private bool immutable = immutable;
public Task<bool> Handle(ConfirmEventArgs<Item> args,
CancellationToken cancellationToken)
{
return Task.FromResult(true);
}
public void Invoke(ItemConfiguration args) =>
args.Name = Value;
}