set cancel options depending on the current target
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
@@ -43,9 +43,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
var walletManager = walletManagerViewModel.WalletManager;
var network = walletManager.Network;
- SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
var enableBack = default(IDisposable);
-
this.WhenAnyValue(x => x.CurrentTarget)
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x =>
@@ -171,6 +169,9 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
base.OnNavigatedTo(isInHistory, disposables);
+ var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
+ SetupCancel(enableCancel: enableCancel, enableCancelOnEscape: enableCancel, enableCancelOnPressed: enableCancel);
+
this.RaisePropertyChanged(WalletName);
if (!isInHistory)

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
+using System.Reactive.Disposables;
using System.Reactive.Linq;
using DynamicData;
using DynamicData.Binding;
@@ -31,8 +32,6 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
.WhenValueChanged(x => x.IsConfirmed)
.Select(_ => confirmationWordsSourceList.Items.All(x => x.IsConfirmed));
- SetupCancel(enableCancel: false, enableCancelOnEscape: false, enableCancelOnPressed: false);
-
EnableBack = true;
NextCommand = ReactiveCommand.Create(() => OnNext(keyManager, walletManager), nextCommandCanExecute);
@@ -67,5 +66,13 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
{
Navigate().Clear();
}
+
+ protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
+ {
+ base.OnNavigatedTo(isInHistory, disposables);
+
+ var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
+ SetupCancel(enableCancel: false, enableCancelOnEscape: enableCancel, enableCancelOnPressed: enableCancel);
+ }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/Create/RecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/Create/RecoveryWordsViewModel.cs
using System.Collections.Generic;
+using System.Reactive.Disposables;
using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Keys;
@@ -22,7 +23,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
MnemonicWords.Add(new RecoveryWordViewModel(i + 1, mnemonic.Words[i]));
}
- SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
+
EnableBack = true;
@@ -41,5 +42,13 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
{
Navigate().Clear();
}
+
+ protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
+ {
+ var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
+ SetupCancel(enableCancel: enableCancel, enableCancelOnEscape: enableCancel, enableCancelOnPressed: enableCancel);
+
+ base.OnNavigatedTo(isInHistory, disposables);
+ }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/ConnectHardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/ConnectHardwareWalletViewModel.cs
@@ -36,8 +36,6 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
AbandonedTasks = new AbandonedTasks();
CancelCts = new CancellationTokenSource();
- SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
-
EnableBack = true;
NextCommand = ReactiveCommand.Create(OnNext);
@@ -224,6 +222,9 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
{
base.OnNavigatedTo(isInHistory, disposables);
+ var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
+ SetupCancel(enableCancel: enableCancel, enableCancelOnEscape: enableCancel, enableCancelOnPressed: enableCancel);
+
if (isInHistory)
{
CancelCts = new CancellationTokenSource();

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
@@ -42,8 +43,6 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
this.ValidateProperty(x => x.Mnemonics, ValidateMnemonics);
- SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
-
EnableBack = true;
NextCommandCanExecute =
@@ -147,5 +146,13 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
return string.Join(' ', Mnemonics);
}
+
+ protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
+ {
+ base.OnNavigatedTo(isInHistory, disposables);
+
+ var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
+ SetupCancel(enableCancel: enableCancel, enableCancelOnEscape: enableCancel, enableCancelOnPressed: enableCancel);
+ }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/CreatePasswordDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/CreatePasswordDialogViewModel.cs
+using System.Reactive.Disposables;
using System.Reactive.Linq;
using ReactiveUI;
using WalletWasabi.Fluent.Validation;
@@ -24,8 +25,6 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
this.ValidateProperty(x => x.Password, ValidatePassword);
this.ValidateProperty(x => x.ConfirmPassword, ValidateConfirmPassword);
- SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
-
EnableBack = true;
var backCommandCanExecute = this.WhenAnyValue(x => x.IsDialogOpen).ObserveOn(RxApp.MainThreadScheduler);
@@ -83,5 +82,13 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
errors.Add(ErrorSeverity.Error, PasswordHelper.PasswordTooLongMessage);
}
}
+
+ protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
+ {
+ base.OnNavigatedTo(isInHistory, disposables);
+
+ var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
+ SetupCancel(enableCancel: enableCancel, enableCancelOnEscape: enableCancel, enableCancelOnPressed: enableCancel);
+ }
}
}

set cancel options depending on the current target