show always in dialog
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
@@ -32,6 +32,8 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
NavBarPosition = NavBarPosition.Bottom)]
public partial class AddWalletPageViewModel : NavBarItemViewModel
{
+ private readonly WalletManager _walletManager;
+
[AutoNotify] private string _walletName = "";
[AutoNotify] private bool _optionsEnabled;
@@ -40,8 +42,8 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
BitcoinStore store)
{
SelectionMode = NavBarItemSelectionMode.Button;
- var walletManager = walletManagerViewModel.WalletManager;
- var network = walletManager.Network;
+ _walletManager = walletManagerViewModel.WalletManager;
+ var network = _walletManager.Network;
var enableBack = default(IDisposable);
this.WhenAnyValue(x => x.CurrentTarget)
@@ -61,13 +63,13 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
RecoverWalletCommand = ReactiveCommand.Create(() => OnRecoverWallet(walletManagerViewModel));
- ImportWalletCommand = ReactiveCommand.CreateFromTask(async () => await OnImportWallet(walletManager));
+ ImportWalletCommand = ReactiveCommand.CreateFromTask(async () => await OnImportWallet(_walletManager));
ConnectHardwareWalletCommand = ReactiveCommand.Create(() => OnConnectHardwareWallet(walletManagerViewModel));
- CreateWalletCommand = ReactiveCommand.CreateFromTask(async () => await OnCreateWallet(walletManager, store, network));
+ CreateWalletCommand = ReactiveCommand.CreateFromTask(async () => await OnCreateWallet(_walletManager, store, network));
- this.ValidateProperty(x => x.WalletName, errors => ValidateWalletName(errors, walletManager, WalletName));
+ this.ValidateProperty(x => x.WalletName, errors => ValidateWalletName(errors, _walletManager, WalletName));
EnableAutoBusyOn(CreateWalletCommand);
}
@@ -145,7 +147,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
private async Task OnCreateWallet(WalletManager walletManager, BitcoinStore store, Network network)
{
var dialogResult = await NavigateDialog(
- new CreatePasswordDialogViewModel("Type the password of the wallet and click Continue."));
+ new CreatePasswordDialogViewModel("Type the password of the wallet and click Continue.", enableEmpty: true, enableCancel: _walletManager.HasWallet()));
if (dialogResult.Result is { } password)
{
@@ -169,7 +171,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
base.OnNavigatedTo(isInHistory, disposables);
- var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
+ var enableCancel = _walletManager.HasWallet();
SetupCancel(enableCancel: enableCancel, enableCancelOnEscape: enableCancel, enableCancelOnPressed: enableCancel);
this.RaisePropertyChanged(WalletName);

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
@@ -17,11 +17,13 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
[NavigationMetaData(Title = "Confirm recovery words")]
public partial class ConfirmRecoveryWordsViewModel : RoutableViewModel
{
+ private readonly WalletManager _walletManager;
private readonly ReadOnlyObservableCollection<RecoveryWordViewModel> _confirmationWords;
[AutoNotify] private bool _isSkipEnable;
public ConfirmRecoveryWordsViewModel(List<RecoveryWordViewModel> mnemonicWords, KeyManager keyManager, WalletManager walletManager)
{
+ _walletManager = walletManager;
var confirmationWordsSourceList = new SourceList<RecoveryWordViewModel>();
_isSkipEnable = walletManager.Network != Network.Main || System.Diagnostics.Debugger.IsAttached;
@@ -71,7 +73,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
{
base.OnNavigatedTo(isInHistory, disposables);
- var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
+ var enableCancel = _walletManager.HasWallet();
SetupCancel(enableCancel: false, enableCancelOnEscape: enableCancel, enableCancelOnPressed: enableCancel);
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/Create/RecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/Create/RecoveryWordsViewModel.cs
@@ -11,11 +11,14 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
[NavigationMetaData(Title = "Recovery words")]
public partial class RecoveryWordsViewModel : RoutableViewModel
{
+ private readonly WalletManager _walletManager;
+
public RecoveryWordsViewModel(
KeyManager keyManager,
Mnemonic mnemonic,
WalletManager walletManager)
{
+ _walletManager = walletManager;
MnemonicWords = new List<RecoveryWordViewModel>();
for (int i = 0; i < mnemonic.Words.Length; i++)
@@ -43,7 +46,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
- var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
+ var enableCancel = _walletManager.HasWallet();
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
@@ -222,7 +222,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
{
base.OnNavigatedTo(isInHistory, disposables);
- var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
+ var enableCancel = WalletManager.HasWallet();
SetupCancel(enableCancel: enableCancel, enableCancelOnEscape: enableCancel, enableCancelOnPressed: enableCancel);
if (isInHistory)

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -23,6 +23,8 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
[NavigationMetaData(Title = "Enter recovery words")]
public partial class RecoverWalletViewModel : RoutableViewModel
{
+ private readonly WalletManager _walletManager;
+
[AutoNotify] private IEnumerable<string>? _suggestions;
[AutoNotify] private Mnemonic? _currentMnemonics;
@@ -31,8 +33,8 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
WalletManagerViewModel walletManagerViewModel)
{
Suggestions = new Mnemonic(Wordlist.English, WordCount.Twelve).WordList.GetWords();
- var walletManager = walletManagerViewModel.WalletManager;
- var network = walletManager.Network;
+ _walletManager = walletManagerViewModel.WalletManager;
+ var network = _walletManager.Network;
Mnemonics.ToObservableChangeSet().ToCollection()
.Select(x => x.Count is 12 or 15 or 18 or 21 or 24 ? new Mnemonic(GetTagsAsConcatString().ToLowerInvariant()) : default)
@@ -50,7 +52,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
.Select(currentMnemonics => currentMnemonics is { } && !Validations.Any);
NextCommand = ReactiveCommand.CreateFromTask(
- async () => await OnNext(walletManager, network, walletName),
+ async () => await OnNext(_walletManager, network, walletName),
NextCommandCanExecute);
AdvancedRecoveryOptionsDialogCommand = ReactiveCommand.CreateFromTask(
@@ -151,7 +153,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
base.OnNavigatedTo(isInHistory, disposables);
- var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
+ var enableCancel = _walletManager.HasWallet();
SetupCancel(enableCancel: enableCancel, enableCancelOnEscape: enableCancel, enableCancelOnPressed: enableCancel);
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/CreatePasswordDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/CreatePasswordDialogViewModel.cs
@@ -11,11 +11,14 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
[NavigationMetaData(Title = "Enter a password")]
public partial class CreatePasswordDialogViewModel : DialogViewModelBase<string?>
{
+ private readonly bool _enableCancel;
+
[AutoNotify] private string? _confirmPassword;
[AutoNotify] private string? _password;
- public CreatePasswordDialogViewModel(string caption, bool enableEmpty = true)
+ public CreatePasswordDialogViewModel(string caption, bool enableEmpty = true, bool enableCancel = true)
{
+ _enableCancel = enableCancel;
Caption = caption;
// This means pressing continue will make the password empty string.
@@ -87,8 +90,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
{
base.OnNavigatedTo(isInHistory, disposables);
- var enableCancel = CurrentTarget != NavigationTarget.FullScreen;
- SetupCancel(enableCancel: enableCancel, enableCancelOnEscape: enableCancel, enableCancelOnPressed: enableCancel);
+ SetupCancel(enableCancel: _enableCancel, enableCancelOnEscape: _enableCancel, enableCancelOnPressed: _enableCancel);
}
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
@@ -111,9 +111,9 @@ namespace WalletWasabi.Fluent.ViewModels
_walletManagerViewModel.WhenAnyValue(x => x.Items.Count, x => x.Actions.Count)
.Subscribe(x => _navBar.IsHidden = x.Item1 == 0 && x.Item2 == 0);
- if (!_walletManagerViewModel.WalletManager.AnyWallet(_ => true))
+ if (!_walletManagerViewModel.WalletManager.HasWallet())
{
- _fullScreen.To(_addWalletPage, NavigationMode.Clear);
+ _dialogScreen.To(_addWalletPage, NavigationMode.Clear);
}
}

MODIFY
WalletWasabi/Wallets/WalletManager.cs
WalletWasabi/Wallets/WalletManager.cs
@@ -122,6 +122,8 @@ namespace WalletWasabi.Wallets
}
}
+ public bool HasWallet() => AnyWallet(_ => true);
+
public bool AnyWallet()
{
return AnyWallet(x => x.State >= WalletState.Starting);

show always in dialog