From 43f64f877c3ecf6340ab2666fd5937dbfc849906 Mon Sep 17 00:00:00 2001 From: TheXamlGuy Date: Sat, 15 Jun 2024 20:15:58 +0100 Subject: [PATCH] Added an ActivityLock for locking into an activity state --- Wallet/CreateWalletViewModel.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Wallet/CreateWalletViewModel.cs b/Wallet/CreateWalletViewModel.cs index 948bc31..ad9b672 100644 --- a/Wallet/CreateWalletViewModel.cs +++ b/Wallet/CreateWalletViewModel.cs @@ -21,7 +21,12 @@ public partial class CreateWalletViewModel(IServiceProvider provider, [ObservableProperty] private string password; - public async Task Confirm() => - await Mediator.Handle>, - bool>(Create.As(new Wallet<(string, string)>((Name, Password)))); + public async Task Confirm() + { + using (await new ActivityLock(this)) + { + return await Mediator.Handle>, + bool>(Create.As(new Wallet<(string, string)>((Name, Password)))); + } + } } \ No newline at end of file