From dfda72dd1eacf46ee2642b45afc29dbae287d302 Mon Sep 17 00:00:00 2001 From: TheXamlGuy Date: Mon, 10 Jun 2024 22:29:18 +0100 Subject: [PATCH] Dialog deferrals --- Wallet.Avalonia/CreateWalletView.axaml | 1 + Wallet.Avalonia/WalletNavigationView.axaml | 10 ++++++---- Wallet/CreateWalletViewModel.cs | 3 ++- Wallet/OpenWalletViewModel.cs | 3 ++- Wallet/SynchronizeMainViewModelHandler.cs | 1 + 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Wallet.Avalonia/CreateWalletView.axaml b/Wallet.Avalonia/CreateWalletView.axaml index 2c38351..d3c6216 100644 --- a/Wallet.Avalonia/CreateWalletView.axaml +++ b/Wallet.Avalonia/CreateWalletView.axaml @@ -6,6 +6,7 @@ Title="Create Wallet" x:DataType="vm:CreateWalletViewModel" CloseButtonText="Cancel" + IsPrimaryButtonEnabled="{Binding !Active}" PrimaryButtonText="Create"> @@ -47,6 +48,7 @@ + @@ -86,12 +88,12 @@ - - + + - - + + diff --git a/Wallet/CreateWalletViewModel.cs b/Wallet/CreateWalletViewModel.cs index 90c73ea..ba88019 100644 --- a/Wallet/CreateWalletViewModel.cs +++ b/Wallet/CreateWalletViewModel.cs @@ -22,5 +22,6 @@ public partial class CreateWalletViewModel(IServiceProvider provider, private string password; public async Task Confirm() => - await Mediator.Handle>, bool>(Create.As(new Wallet<(string, string)>((Name, Password)))); + await Mediator.Handle>, + bool>(Create.As(new Wallet<(string, string)>((Name, Password)))); } \ No newline at end of file diff --git a/Wallet/OpenWalletViewModel.cs b/Wallet/OpenWalletViewModel.cs index ea3ca0c..4b886ef 100644 --- a/Wallet/OpenWalletViewModel.cs +++ b/Wallet/OpenWalletViewModel.cs @@ -24,7 +24,8 @@ public partial class OpenWalletViewModel(IServiceProvider provider, { if (Password is { Length: > 0 }) { - if (await Mediator.Handle>, bool>(Activate.As(new Wallet(Password)))) + if (await Mediator.Handle>, + bool>(Activate.As(new Wallet(Password)))) { Publisher.Publish(Opened.As()); } diff --git a/Wallet/SynchronizeMainViewModelHandler.cs b/Wallet/SynchronizeMainViewModelHandler.cs index 641dd15..9c82bbc 100644 --- a/Wallet/SynchronizeMainViewModelHandler.cs +++ b/Wallet/SynchronizeMainViewModelHandler.cs @@ -10,6 +10,7 @@ public class SynchronizeMainViewModelHandler(IPublisher publisher, public Task Handle(SynchronizeEventArgs args) { bool selected = true; + foreach (IComponentHost Wallet in Wallets.OrderBy(x => x.Services.GetRequiredService>() is IConfigurationDescriptor descriptor ? descriptor.Name : null)) {