Allow subscription keys to be resolved by reflection

This commit is contained in:
TheXamlGuy
2024-06-02 18:48:51 +01:00
parent 79a94c7470
commit 91a968d34c
31 changed files with 201 additions and 111 deletions
+7 -5
View File
@@ -3,9 +3,11 @@ using Toolkit.Foundation;
namespace Bitvault;
public partial class ItemHeaderViewModel : Observable<string, string>,
[Notification(typeof(ConfirmEventArgs<Item>), nameof(ItemHeader))]
public partial class ItemHeaderViewModel :
Observable<string, string>,
IHandler<ValidationEventArgs<Item>, bool>,
IHandler<ConfirmEventArgs<Item>, ItemHeaderConfiguration>,
IHandler<ConfirmEventArgs<Item>, string?>,
INotificationHandler<UpdateEventArgs<Item>>,
INotificationHandler<ConfirmEventArgs<Item>>,
INotificationHandler<CancelEventArgs<Item>>,
@@ -38,9 +40,6 @@ public partial class ItemHeaderViewModel : Observable<string, string>,
return Task.FromResult(true);
}
public Task<ItemHeaderConfiguration> Handle(ConfirmEventArgs<Item> args,
CancellationToken cancellationToken) => Task.FromResult(new ItemHeaderConfiguration { Name = Value! });
public Task Handle(UpdateEventArgs<Item> args) =>
Task.FromResult(State = ItemState.Write);
@@ -69,4 +68,7 @@ public partial class ItemHeaderViewModel : Observable<string, string>,
return Task.CompletedTask;
}
public Task<string?> Handle(ConfirmEventArgs<Item> args,
CancellationToken cancellationToken) => Task.FromResult(Value);
}