allow closing dialog by pressing esc
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/ConfirmLabelsDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/ConfirmLabelsDialogViewModel.cs
@@ -10,10 +10,10 @@ public partial class ConfirmLabelsDialogViewModel : DialogViewModelBase<bool>
{
public ConfirmLabelsDialogViewModel(PocketSuggestionViewModel suggestion)
{
- SetupCancel(true, false, false);
+ SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: false);
- NextCommand = ReactiveCommand.Create(() => Close());
- CancelCommand = ReactiveCommand.Create(() => Close(DialogResultKind.Normal, true));
+ CancelCommand = ReactiveCommand.Create(() => Close());
+ NextCommand = ReactiveCommand.Create(() => Close(DialogResultKind.Normal, true));
Suggestion = suggestion;
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -365,12 +365,11 @@ public partial class TransactionPreviewViewModel : RoutableViewModel
private async Task<bool> NavigateConfirmLabelsDialogAsync(BuildTransactionResult transaction)
{
- return (await NavigateDialogAsync(
- new ConfirmLabelsDialogViewModel(
- new PocketSuggestionViewModel(SmartLabel.Merge(
- transaction.SpentCoins.Select(
- x => x.GetLabels(_wallet.KeyManager.MinAnonScoreTarget))))),
- NavigationTarget.CompactDialogScreen)).Result;
+ var labels = SmartLabel.Merge(transaction.SpentCoins.Select(x => x.GetLabels(_wallet.KeyManager.MinAnonScoreTarget)));
+ var suggestionViewModel = new PocketSuggestionViewModel(labels);
+ var dialog = new ConfirmLabelsDialogViewModel(suggestionViewModel);
+
+ return (await NavigateDialogAsync(dialog, NavigationTarget.CompactDialogScreen)).Result;
}
private async Task InitialiseViewModelAsync()
@@ -381,7 +380,7 @@ public partial class TransactionPreviewViewModel : RoutableViewModel
var suggestionTask = PrivacySuggestions.BuildPrivacySuggestionsAsync(_wallet, _info, _destination, initialTransaction, _isFixedAmount, _cancellationTokenSource.Token);
- if (CurrentTransactionSummary.TransactionHasPockets && !await NavigateConfirmLabelsDialogAsync(initialTransaction))
+ if (CurrentTransactionSummary.TransactionHasPockets && await NavigateConfirmLabelsDialogAsync(initialTransaction))
{
await OnChangePocketsAsync();
}

allow closing dialog by pressing esc