diff --git a/WalletWasabi.Fluent/Controls/UICommand.cs b/WalletWasabi.Fluent/Controls/UICommand.cs new file mode 100644 index 00000000000..5cfa155d3a3 --- /dev/null +++ b/WalletWasabi.Fluent/Controls/UICommand.cs @@ -0,0 +1,43 @@ +using Avalonia; +using System.Windows.Input; + +namespace WalletWasabi.Fluent.Controls; + +public class UICommand : AvaloniaObject, IUICommand +{ + public static readonly StyledProperty NameProperty = + AvaloniaProperty.Register(nameof(Name)); + + public static readonly StyledProperty IconProperty = + AvaloniaProperty.Register(nameof(Icon)); + + public static readonly StyledProperty CommandProperty = + AvaloniaProperty.Register(nameof(Command)); + + public static readonly StyledProperty IsDefaultProperty = + AvaloniaProperty.Register(nameof(IsDefault)); + + public string Name + { + get => GetValue(NameProperty); + set => SetValue(NameProperty, value); + } + + public object Icon + { + get => GetValue(IconProperty); + set => SetValue(IconProperty, value); + } + + public ICommand Command + { + get => GetValue(CommandProperty); + set => SetValue(CommandProperty, value); + } + + public bool IsDefault + { + get => GetValue(IsDefaultProperty); + set => SetValue(IsDefaultProperty, value); + } +} diff --git a/WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs b/WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs index a51e52b92b2..8779a4c63ad 100644 --- a/WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs +++ b/WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs @@ -88,7 +88,7 @@ public SendViewModel(UiContext uiContext, IWalletModel walletModel, SendParamete SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true); - EnableBack = false; + EnableBack = parameters.IsManual; this.ValidateProperty(x => x.To, ValidateToField); this.ValidateProperty(x => x.AmountBtc, ValidateAmount); diff --git a/WalletWasabi.Fluent/Views/Wallets/WalletView.axaml b/WalletWasabi.Fluent/Views/Wallets/WalletView.axaml index 0ef8d8a3f0d..24d2074ebf7 100644 --- a/WalletWasabi.Fluent/Views/Wallets/WalletView.axaml +++ b/WalletWasabi.Fluent/Views/Wallets/WalletView.axaml @@ -36,25 +36,22 @@ - - - - + + + + + + + + + + +