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
+1 -13
View File
@@ -4,8 +4,7 @@ using Toolkit.Foundation;
namespace Bitvault;
public partial class ItemViewModel :
ObservableCollectionViewModel<IItemViewModel>,
INotificationHandler<ConfirmEventArgs<Item>>
ObservableCollectionViewModel<IDisposable>
{
[ObservableProperty]
private int? id;
@@ -37,15 +36,4 @@ public partial class ItemViewModel :
}
public IContentTemplate Template { get; set; }
public async Task Handle(ConfirmEventArgs<Item> args)
{
ItemConfiguration configuration = new();
foreach (IItemViewModel item in this)
{
item.Invoke(configuration);
}
await Mediator.Handle<CreateEventArgs<ItemConfiguration>, bool>(Create.As(configuration));
}
}