Initialize the backing field instead of the property in the constructor
MODIFY
WalletWasabi.Fluent/ViewModels/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletViewModel.cs
@@ -22,7 +22,7 @@ namespace WalletWasabi.Fluent.ViewModels
{
Disposables = Disposables is null ? new CompositeDisposable() : throw new NotSupportedException($"Cannot open {GetType().Name} before closing it.");
- Actions = new ObservableCollection<ViewModelBase>();
+ _actions = new ObservableCollection<ViewModelBase>();
uiConfig = Locator.Current.GetService<Global>().UiConfig;

MODIFY
WalletWasabi.Gui/Controls/QrCode.cs
WalletWasabi.Gui/Controls/QrCode.cs
@@ -44,7 +44,7 @@ namespace WalletWasabi.Gui.Controls
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x => FinalMatrix = AddPaddingToMatrix(x));
- SaveCommand = ReactiveCommand.CreateFromTask<string, Unit>(SaveQRCodeAsync);
+ _saveCommand = ReactiveCommand.CreateFromTask<string, Unit>(SaveQRCodeAsync);
SaveCommand.ThrownExceptions
.ObserveOn(RxApp.TaskpoolScheduler)

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -56,7 +56,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
this.ValidateProperty(x => x.Password, ValidatePassword);
- Password = "";
+ _password = "";
TimeLeftTillRoundTimeout = TimeSpan.Zero;
CoinsList = new CoinListViewModel(Wallet, canDequeueCoins: true);
@@ -65,7 +65,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
.FromEventPattern<SmartCoin>(CoinsList, nameof(CoinsList.DequeueCoinsPressed))
.Subscribe(async x => await DoDequeueAsync(x.EventArgs));
- AmountQueued = Money.Zero; // Global.ChaumianClient.State.SumAllQueuedCoinAmounts();
+ _amountQueued = Money.Zero;
EnqueueCommand = ReactiveCommand.CreateFromTask(async () => await DoEnqueueAsync(CoinsList.Coins.Where(c => c.IsSelected).Select(c => c.Model)));

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -33,7 +33,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Global = Locator.Current.GetService<Global>();
Wallet = wallet;
- Transactions = new ObservableCollection<TransactionViewModel>();
+ _transactions = new ObservableCollection<TransactionViewModel>();
ValidateSavedColumnConfig();

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
@@ -72,7 +72,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Wallet = wallet;
LabelSuggestion = new SuggestLabelViewModel();
- BuildTransactionButtonText = DoButtonText;
+ _buildTransactionButtonText = DoButtonText;
this.ValidateProperty(x => x.Address, ValidateAddress);
this.ValidateProperty(x => x.CustomChangeAddress, ValidateCustomChangeAddress);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterViewModel.cs
@@ -31,7 +31,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
Global = Locator.Current.GetService<Global>();
- ButtonText = "Broadcast Transaction";
+ _buttonText = "Broadcast Transaction";
this.WhenAnyValue(x => x.FinalTransaction)
.ObserveOn(RxApp.MainThreadScheduler)

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -23,7 +23,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
Disposables = Disposables is null ? new CompositeDisposable() : throw new NotSupportedException($"Cannot open {GetType().Name} before closing it.");
- Actions = new ObservableCollection<ViewModelBase>();
+ _actions = new ObservableCollection<ViewModelBase>();
UiConfig = Locator.Current.GetService<Global>().UiConfig;

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -62,21 +62,21 @@ namespace WalletWasabi.Gui.Tabs
var config = new Config(Global.Config.FilePath);
config.LoadOrCreateDefaultFile();
- Network = config.Network;
- TorSocks5EndPoint = config.TorSocks5EndPoint.ToString(-1);
+ _network = config.Network;
+ _torSocks5EndPoint = config.TorSocks5EndPoint.ToString(-1);
UseTor = config.UseTor;
TerminateTorOnExit = config.TerminateTorOnExit;
StartLocalBitcoinCoreOnStartup = config.StartLocalBitcoinCoreOnStartup;
StopLocalBitcoinCoreOnShutdown = config.StopLocalBitcoinCoreOnShutdown;
- SomePrivacyLevel = config.PrivacyLevelSome.ToString();
- FinePrivacyLevel = config.PrivacyLevelFine.ToString();
- StrongPrivacyLevel = config.PrivacyLevelStrong.ToString();
+ _somePrivacyLevel = config.PrivacyLevelSome.ToString();
+ _finePrivacyLevel = config.PrivacyLevelFine.ToString();
+ _strongPrivacyLevel = config.PrivacyLevelStrong.ToString();
- DustThreshold = config.DustThreshold.ToString();
+ _dustThreshold = config.DustThreshold.ToString();
- BitcoinP2pEndPoint = config.GetP2PEndpoint().ToString(defaultPort: -1);
- LocalBitcoinCoreDataDir = config.LocalBitcoinCoreDataDir;
+ _bitcoinP2pEndPoint = config.GetP2PEndpoint().ToString(defaultPort: -1);
+ _localBitcoinCoreDataDir = config.LocalBitcoinCoreDataDir;
IsModified = !Global.Config.AreDeepEqual(config);

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/HardwareWallets/ConnectHardwareWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/HardwareWallets/ConnectHardwareWalletViewModel.cs
@@ -43,7 +43,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager.HardwareWallets
Global = Locator.Current.GetService<Global>();
WalletManager = Global.WalletManager;
Owner = owner;
- Wallets = new ObservableCollection<HardwareWalletViewModel>();
+ _wallets = new ObservableCollection<HardwareWalletViewModel>();
IsHwWalletSearchTextVisible = false;
this.WhenAnyValue(x => x.SelectedWallet)

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWallets/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWallets/LoadWalletViewModel.cs
@@ -40,7 +40,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager.LoadWallets
Global = Locator.Current.GetService<Global>();
Owner = owner;
- Password = "";
+ _password = "";
LoadWalletType = loadWalletType;
this.ValidateProperty(x => x.Password, ValidatePassword);

MODIFY
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
@@ -42,7 +42,7 @@ namespace WalletWasabi.Gui.ViewModels
InitializeLockScreen();
- StatusBar = statusBarViewModel;
+ _statusBar = statusBarViewModel;
if (initWalletManager)
{

MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -63,7 +63,7 @@ namespace WalletWasabi.Gui.ViewModels
UseTor = false;
Tor = TorStatus.NotRunning;
Peers = 0;
- ExchangeRate = "";
+ _exchangeRate = "";
IsExchangeRateAvailable = false;
ActiveStatuses = new StatusSet();
}

MODIFY
WalletWasabi/Blockchain/Analysis/Clustering/Cluster.cs
WalletWasabi/Blockchain/Analysis/Clustering/Cluster.cs
@@ -20,7 +20,7 @@ namespace WalletWasabi.Blockchain.Analysis.Clustering
Lock = new object();
Coins = coins.ToList();
CoinsSet = Coins.ToHashSet();
- Labels = SmartLabel.Merge(Coins.Select(x => x.Label));
+ _labels = SmartLabel.Merge(Coins.Select(x => x.Label));
}
public SmartLabel Labels

Initialize the backing field instead of the property in the constructor