diff --git a/Wallet.Avalonia/OpenWalletView.axaml b/Wallet.Avalonia/OpenWalletView.axaml index 11245a6..e03d74d 100644 --- a/Wallet.Avalonia/OpenWalletView.axaml +++ b/Wallet.Avalonia/OpenWalletView.axaml @@ -7,11 +7,11 @@ + diff --git a/Wallet/OpenWalletViewModel.cs b/Wallet/OpenWalletViewModel.cs index 2d307c9..d3f0328 100644 --- a/Wallet/OpenWalletViewModel.cs +++ b/Wallet/OpenWalletViewModel.cs @@ -1,5 +1,6 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; +using System.ComponentModel.DataAnnotations; using Toolkit.Foundation; namespace Wallet; @@ -22,12 +23,14 @@ public partial class OpenWalletViewModel(IServiceProvider provider, [RelayCommand] private async Task Invoke() { - if (Password is { Length: > 0 }) + using (await new ActivityLock(this)) { - if (await Mediator.Handle>, - bool>(Activate.As(new Wallet(Password)))) + if (Password is { Length: > 0 }) { - Publisher.Publish(Opened.As()); + if (await Mediator.Handle>, bool>(Activate.As(new Wallet(Password)))) + { + Publisher.Publish(Opened.As()); + } } } }