Make it possible to remove enteries

This commit is contained in:
TheXamlGuy
2024-08-01 23:19:30 +01:00
parent 9e25f7ea60
commit 0c21ddd20d
8 changed files with 234 additions and 245 deletions
+6
View File
@@ -7,6 +7,7 @@ namespace Wallet;
public partial class ItemEntryViewModel<TValue> :
Observable<string, TValue>,
IItemEntryViewModel,
IRemovable,
IHandler<ValidateEventArgs<ItemEntry>, bool>,
INotificationHandler<ConfirmEventArgs<ItemEntry>>,
INotificationHandler<UpdateEventArgs<ItemEntry>>,
@@ -69,6 +70,8 @@ public partial class ItemEntryViewModel<TValue> :
return Task.CompletedTask;
}
public async Task<bool> Handle(ValidateEventArgs<ItemEntry> args,
CancellationToken cancellationToken)
{
@@ -80,6 +83,9 @@ public partial class ItemEntryViewModel<TValue> :
return await Task.FromResult(true);
}
[RelayCommand]
private void Remove() => Dispose();
[RelayCommand]
private void Copy() => Publisher.Publish(Write.As(new Clipboard<object>($"{Value}")));