Move methods
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
@@ -76,6 +76,43 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
EnableAutoBusyOn(CreateWalletCommand);
}
+ private static void ValidateWalletName(IValidationErrors errors, WalletManager walletManager, string walletName)
+ {
+ string walletFilePath = Path.Combine(walletManager.WalletDirectories.WalletsDir, $"{walletName}.json");
+
+ if (string.IsNullOrEmpty(walletName))
+ {
+ return;
+ }
+
+ if (walletName.IsTrimmable())
+ {
+ errors.Add(ErrorSeverity.Error, "Leading and trailing white spaces are not allowed!");
+ return;
+ }
+
+ if (File.Exists(walletFilePath))
+ {
+ errors.Add(
+ ErrorSeverity.Error,
+ $"A wallet named {walletName} already exists. Please try a different name.");
+ return;
+ }
+
+ if (!WalletGenerator.ValidateWalletName(walletName))
+ {
+ errors.Add(ErrorSeverity.Error, "Selected Wallet is not valid. Please try a different name.");
+ }
+ }
+
+ public ICommand CreateWalletCommand { get; }
+
+ public ICommand RecoverWalletCommand { get; }
+
+ public ICommand ImportWalletCommand { get; }
+
+ public ICommand ConnectHardwareWalletCommand { get; }
+
private void RecoverWalletExecute(WalletManagerViewModel walletManagerViewModel)
{
Navigate().To(new RecoverWalletViewModel(WalletName, walletManagerViewModel));
@@ -146,42 +183,5 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
WalletName = "";
}
}
-
- private static void ValidateWalletName(IValidationErrors errors, WalletManager walletManager, string walletName)
- {
- string walletFilePath = Path.Combine(walletManager.WalletDirectories.WalletsDir, $"{walletName}.json");
-
- if (string.IsNullOrEmpty(walletName))
- {
- return;
- }
-
- if (walletName.IsTrimmable())
- {
- errors.Add(ErrorSeverity.Error, "Leading and trailing white spaces are not allowed!");
- return;
- }
-
- if (File.Exists(walletFilePath))
- {
- errors.Add(
- ErrorSeverity.Error,
- $"A wallet named {walletName} already exists. Please try a different name.");
- return;
- }
-
- if (!WalletGenerator.ValidateWalletName(walletName))
- {
- errors.Add(ErrorSeverity.Error, "Selected Wallet is not valid. Please try a different name.");
- }
- }
-
- public ICommand CreateWalletCommand { get; }
-
- public ICommand RecoverWalletCommand { get; }
-
- public ICommand ImportWalletCommand { get; }
-
- public ICommand ConnectHardwareWalletCommand { get; }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddedWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddedWalletPageViewModel.cs
@@ -20,6 +20,11 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
NextCommand = ReactiveCommand.Create(() => NextExecute(walletManager, keyManager));
}
+ public string? WalletIcon { get; }
+
+ public bool IsHardwareWallet { get; }
+
+ public string WalletName { get; }
private void NextExecute(WalletManager walletManager, KeyManager keyManager)
{
@@ -37,11 +42,5 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
wallet.OpenCommand.Execute(default);
}
}
-
- public string? WalletIcon { get; }
-
- public bool IsHardwareWallet { get; }
-
- public string WalletName { get; }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
@@ -54,6 +54,8 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
confirmationWordsSourceList.AddRange(mnemonicWords.OrderBy(_ => new Random().NextDouble()).Take(4));
}
+ public ReadOnlyObservableCollection<RecoveryWordViewModel> ConfirmationWords => _confirmationWords;
+
private void NextExecute(KeyManager keyManager, WalletManager walletManager)
{
Navigate().To(new AddedWalletPageViewModel(walletManager, keyManager));
@@ -63,7 +65,5 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
{
Navigate().Clear();
}
-
- public ReadOnlyObservableCollection<RecoveryWordViewModel> ConfirmationWords => _confirmationWords;
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/Create/RecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/Create/RecoveryWordsViewModel.cs
@@ -26,6 +26,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
CancelCommand = ReactiveCommand.Create(CancelExecute);
}
+ public List<RecoveryWordViewModel> MnemonicWords { get; set; }
private void NextExecute(KeyManager keyManager, WalletManager walletManager)
{
@@ -36,7 +37,5 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
{
Navigate().Clear();
}
-
- public List<RecoveryWordViewModel> MnemonicWords { get; set; }
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/ConnectHardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/ConnectHardwareWalletViewModel.cs
@@ -48,6 +48,24 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
.Subscribe(message => ConfirmationRequired = !string.IsNullOrEmpty(message));
}
+ private HwiEnumerateEntry? DetectedDevice { get; set; }
+
+ public CancellationTokenSource CancelCts { get; set; }
+
+ private AbandonedTasks AbandonedTasks { get; }
+
+ public string WalletName { get; }
+
+ public WalletManager WalletManager { get; }
+
+ public ObservableCollection<WalletViewModelBase> Wallets { get; }
+
+ public WalletViewModelBase? ExistingWallet { get; set; }
+
+ public ICommand OpenBrowserCommand { get; }
+
+ public ICommand NavigateToExistingWalletLoginCommand { get; }
+
private void NextExecute()
{
if (DetectedDevice is { } device)
@@ -71,24 +89,6 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
}
}
- private HwiEnumerateEntry? DetectedDevice { get; set; }
-
- public CancellationTokenSource CancelCts { get; set; }
-
- private AbandonedTasks AbandonedTasks { get; }
-
- public string WalletName { get; }
-
- public WalletManager WalletManager { get; }
-
- public ObservableCollection<WalletViewModelBase> Wallets { get; }
-
- public WalletViewModelBase? ExistingWallet { get; set; }
-
- public ICommand OpenBrowserCommand { get; }
-
- public ICommand NavigateToExistingWalletLoginCommand { get; }
-
private void StartDetection()
{
Message = "";

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/DetectedHardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/DetectedHardwareWalletViewModel.cs
@@ -39,6 +39,18 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
EnableAutoBusyOn(NextCommand);
}
+ public CancellationTokenSource CancelCts { get; }
+
+ public WalletManager WalletManager { get; }
+
+ public string WalletName { get; }
+
+ public WalletType Type { get; }
+
+ public string TypeName { get; }
+
+ public ICommand NoCommand { get; }
+
private async Task NextExecute(WalletManager walletManager, HwiEnumerateEntry device)
{
try
@@ -63,18 +75,6 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
Navigate().Back();
}
- public CancellationTokenSource CancelCts { get; }
-
- public WalletManager WalletManager { get; }
-
- public string WalletName { get; }
-
- public WalletType Type { get; }
-
- public string TypeName { get; }
-
- public ICommand NoCommand { get; }
-
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
base.OnNavigatedTo(isInHistory, disposables);

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -62,6 +62,18 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
EnableAutoBusyOn(NextCommand);
}
+ public IObservable<bool> FinishCommandCanExecute { get; }
+
+ public ICommand AdvancedRecoveryOptionsDialogCommand { get; }
+
+ private KeyPath AccountKeyPath { get; set; } = KeyPath.Parse("m/84'/0'/0'");
+
+ private int MinGapLimit { get; set; } = 63;
+
+ private Interaction<(KeyPath, int), (KeyPath?, int?)> AdvancedOptionsInteraction { get; }
+
+ public ObservableCollection<string> Mnemonics { get; } = new();
+
private async Task NextExecute(WalletManager walletManager, Network network, string? walletName)
{
var dialogResult = await NavigateDialog(
@@ -119,18 +131,6 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
}
}
- public IObservable<bool> FinishCommandCanExecute { get; }
-
- public ICommand AdvancedRecoveryOptionsDialogCommand { get; }
-
- private KeyPath AccountKeyPath { get; set; } = KeyPath.Parse("m/84'/0'/0'");
-
- private int MinGapLimit { get; set; } = 63;
-
- private Interaction<(KeyPath, int), (KeyPath?, int?)> AdvancedOptionsInteraction { get; }
-
- public ObservableCollection<string> Mnemonics { get; } = new();
-
private void ValidateMnemonics(IValidationErrors errors)
{
if (CurrentMnemonics is { } && !CurrentMnemonics.IsValidChecksum)

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/TermsAndConditionsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/TermsAndConditionsViewModel.cs
@@ -20,6 +20,8 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
.ObserveOn(RxApp.MainThreadScheduler));
}
+ public ICommand ViewTermsCommand { get; }
+
private void ViewTermsExecute(string legalDocument)
{
Navigate().To(new LegalDocumentsViewModel(legalDocument));
@@ -29,7 +31,5 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
Close(DialogResultKind.Normal, true);
}
-
- public ICommand ViewTermsCommand { get; }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/NavBar/NavBarItemViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBar/NavBarItemViewModel.cs
@@ -34,18 +34,6 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
});
}
- private void OpenExecute()
- {
- if (SelectionMode == NavBarItemSelectionMode.Toggle)
- {
- Toggle();
- }
- else
- {
- Navigate().To(this, NavigationMode.Clear);
- }
- }
-
public NavBarItemViewModel? Parent { get; set; }
public NavBarItemSelectionMode SelectionMode { get; protected set; }
@@ -69,6 +57,18 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
public ICommand OpenCommand { get; protected set; }
+ private void OpenExecute()
+ {
+ if (SelectionMode == NavBarItemSelectionMode.Toggle)
+ {
+ Toggle();
+ }
+ else
+ {
+ Navigate().To(this, NavigationMode.Clear);
+ }
+ }
+
public virtual void Toggle()
{
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -41,6 +41,20 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
NextCommand = ReactiveCommand.CreateFromTask(async () => await NextExecute(wallet, broadcaster, transaction));
}
+ public string BtcAmountText { get; }
+
+ public string FiatAmountText { get; }
+
+ public string[] Labels { get; }
+
+ public string AddressText { get; }
+
+ public string ConfirmationTimeText { get; }
+
+ public string BtcFeeText { get; }
+
+ public string FiatFeeText { get; }
+
private async Task NextExecute(Wallet wallet, TransactionBroadcaster broadcaster, BuildTransactionResult transaction)
{
var transactionAuthorizationInfo = new TransactionAuthorizationInfo(transaction);
@@ -64,19 +78,5 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
await ShowErrorAsync("Authorization", "The Authorization has failed, please try again.", "");
}
}
-
- public string BtcAmountText { get; }
-
- public string FiatAmountText { get; }
-
- public string[] Labels { get; }
-
- public string AddressText { get; }
-
- public string ConfirmationTimeText { get; }
-
- public string BtcFeeText { get; }
-
- public string FiatFeeText { get; }
}
}
\ No newline at end of file

Move methods