use new declarative validation style.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -16,6 +16,7 @@ using WalletWasabi.CoinJoin.Client.Rounds;
using WalletWasabi.CoinJoin.Common.Models;
using WalletWasabi.Gui.Helpers;
using WalletWasabi.Gui.Models;
+using WalletWasabi.Gui.Validation;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
using WalletWasabi.Logging;
@@ -53,6 +54,8 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Global = Locator.Current.GetService<Global>();
Wallet = wallet;
+ this.ValidateProperty(x => x.Password, ValidatePassword);
+
Password = "";
TimeLeftTillRoundTimeout = TimeSpan.Zero;

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
@@ -29,6 +29,7 @@ using WalletWasabi.Gui.Helpers;
using WalletWasabi.Gui.Models;
using WalletWasabi.Gui.Models.StatusBarStatuses;
using WalletWasabi.Gui.Suggestions;
+using WalletWasabi.Gui.Validation;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
using WalletWasabi.Hwi;
@@ -83,6 +84,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
LabelSuggestion = new SuggestLabelViewModel();
BuildTransactionButtonText = DoButtonText;
+ this.ValidateProperty(x => x.Address, ValidateAddress);
+ this.ValidateProperty(x => x.CustomChangeAddress, ValidateCustomChangeAddress);
+ this.ValidateProperty(x => x.Password, ValidatePassword);
+ this.ValidateProperty(x => x.UserFeeText, ValidateUserFeeText);
+
ResetUi();
SetAmountWatermark(Money.Zero);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoViewModel.cs
@@ -9,6 +9,7 @@ using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Gui.Helpers;
+using WalletWasabi.Gui.Validation;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
using WalletWasabi.Logging;
@@ -31,6 +32,8 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Global = Locator.Current.GetService<Global>();
Wallet = wallet;
+ this.ValidateProperty(x => x.Password, ValidatePassword);
+
ClearSensitiveData(true);
ToggleSensitiveKeysCommand = ReactiveCommand.Create(() =>

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -13,6 +13,7 @@ using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using System.Threading.Tasks;
using WalletWasabi.Gui.Helpers;
+using WalletWasabi.Gui.Validation;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
using WalletWasabi.Logging;
@@ -44,6 +45,13 @@ namespace WalletWasabi.Gui.Tabs
{
Global = Locator.Current.GetService<Global>();
+ this.ValidateProperty(x => x.SomePrivacyLevel, ValidateSomePrivacyLevel);
+ this.ValidateProperty(x => x.FinePrivacyLevel, ValidateFinePrivacyLevel);
+ this.ValidateProperty(x => x.StrongPrivacyLevel, ValidateStrongPrivacyLevel);
+ this.ValidateProperty(x => x.DustThreshold, ValidateDustThreshold);
+ this.ValidateProperty(x => x.TorSocks5EndPoint, ValidateTorSocks5EndPoint);
+ this.ValidateProperty(x => x.BitcoinP2pEndPoint, ValidateBitcoinP2pEndPoint);
+
Autocopy = Global.UiConfig.Autocopy;
CustomFee = Global.UiConfig.IsCustomFee;
CustomChangeAddress = Global.UiConfig.IsCustomChangeAddress;

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/GenerateWallets/GenerateWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/GenerateWallets/GenerateWalletViewModel.cs
@@ -6,6 +6,7 @@ using System.Reactive;
using System.Reactive.Linq;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Gui.Helpers;
+using WalletWasabi.Gui.Validation;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
using WalletWasabi.Logging;
@@ -23,6 +24,8 @@ namespace WalletWasabi.Gui.Tabs.WalletManager.GenerateWallets
Global = Locator.Current.GetService<Global>();
Owner = owner;
+ this.ValidateProperty(x => x.Password, ValidatePassword);
+
NextCommand = ReactiveCommand.Create(DoNextCommand, this.WhenAnyValue(x => x.HasErrors).Select(x => !x));
NextCommand.ThrownExceptions

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWallets/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWallets/LoadWalletViewModel.cs
@@ -18,6 +18,7 @@ using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Gui.Controls.WalletExplorer;
using WalletWasabi.Gui.Helpers;
using WalletWasabi.Gui.Models;
+using WalletWasabi.Gui.Validation;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
using WalletWasabi.Logging;
@@ -43,6 +44,8 @@ namespace WalletWasabi.Gui.Tabs.WalletManager.LoadWallets
Password = "";
LoadWalletType = loadWalletType;
+ this.ValidateProperty(x => x.Password, ValidatePassword);
+
RootList = new SourceList<WalletViewModelBase>();
RootList.Connect()
.AutoRefresh(model => model.WalletState)

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWallets/RecoverWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/RecoverWallets/RecoverWalletViewModel.cs
@@ -13,6 +13,7 @@ using System.Reactive.Linq;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Gui.Helpers;
using WalletWasabi.Gui.Suggestions;
+using WalletWasabi.Gui.Validation;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
using WalletWasabi.Logging;
@@ -36,6 +37,8 @@ namespace WalletWasabi.Gui.Tabs.WalletManager.RecoverWallets
Global = Locator.Current.GetService<Global>();
WalletManager = Global.WalletManager;
+ this.ValidateProperty(x => x.Password, ValidatePassword);
+
MnemonicWords = "";
RecoverCommand = ReactiveCommand.Create(() =>

use new declarative validation style.