little simplification
MODIFY
WalletWasabi.Fluent/ViewModels/Settings/BitcoinTabViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/BitcoinTabViewModel.cs
@@ -20,15 +20,15 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
private bool _stopLocalBitcoinCoreOnShutdown;
private string _bitcoinP2PEndPoint;
- public BitcoinTabViewModel(Global global, Config config) : base(global)
+ public BitcoinTabViewModel(Global global) : base(global)
{
this.ValidateProperty(x => x.BitcoinP2PEndPoint, ValidateBitcoinP2PEndPoint);
- _network = config.Network;
- _startLocalBitcoinCoreOnStartup = config.StartLocalBitcoinCoreOnStartup;
- _localBitcoinCoreDataDir = config.LocalBitcoinCoreDataDir;
- _stopLocalBitcoinCoreOnShutdown = config.StopLocalBitcoinCoreOnShutdown;
- _bitcoinP2PEndPoint = config.GetP2PEndpoint().ToString(defaultPort: -1);
+ _network = global.Config.Network;
+ _startLocalBitcoinCoreOnStartup = global.Config.StartLocalBitcoinCoreOnStartup;
+ _localBitcoinCoreDataDir = global.Config.LocalBitcoinCoreDataDir;
+ _stopLocalBitcoinCoreOnShutdown = global.Config.StopLocalBitcoinCoreOnShutdown;
+ _bitcoinP2PEndPoint = global.Config.GetP2PEndpoint().ToString(defaultPort: -1);
this.WhenAnyValue(
x => x.Network,

MODIFY
WalletWasabi.Fluent/ViewModels/Settings/GeneralTabViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/GeneralTabViewModel.cs
@@ -22,7 +22,7 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
private FeeDisplayFormat _selectedFeeDisplayFormat;
private string _dustThreshold;
- public GeneralTabViewModel(Global global, Config config) : base(global)
+ public GeneralTabViewModel(Global global) : base(global)
{
this.ValidateProperty(x => x.DustThreshold, ValidateDustThreshold);
@@ -33,7 +33,7 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
_selectedFeeDisplayFormat = Enum.IsDefined(typeof(FeeDisplayFormat), global.UiConfig.FeeDisplayFormat)
? (FeeDisplayFormat)global.UiConfig.FeeDisplayFormat
: FeeDisplayFormat.SatoshiPerByte;
- _dustThreshold = config.DustThreshold.ToString();
+ _dustThreshold = global.Config.DustThreshold.ToString();
this.WhenAnyValue(x => x.DustThreshold)
.ObserveOn(RxApp.TaskpoolScheduler)

MODIFY
WalletWasabi.Fluent/ViewModels/Settings/NetworkTabViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/NetworkTabViewModel.cs
@@ -16,13 +16,13 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
private bool _terminateTorOnExit;
private string _torSocks5EndPoint;
- public NetworkTabViewModel(Global global, Config config) : base(global)
+ public NetworkTabViewModel(Global global) : base(global)
{
this.ValidateProperty(x => x.TorSocks5EndPoint, ValidateTorSocks5EndPoint);
- _useTor = config.UseTor;
- _terminateTorOnExit = config.TerminateTorOnExit;
- _torSocks5EndPoint = config.TorSocks5EndPoint.ToString(-1);
+ _useTor = global.Config.UseTor;
+ _terminateTorOnExit = global.Config.TerminateTorOnExit;
+ _torSocks5EndPoint = global.Config.TorSocks5EndPoint.ToString(-1);
this.WhenAnyValue(
x => x.UseTor,

MODIFY
WalletWasabi.Fluent/ViewModels/Settings/PrivacyTabViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/PrivacyTabViewModel.cs
@@ -11,11 +11,11 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
private int _mediumPrivacyLevel;
private int _strongPrivacyLevel;
- public PrivacyTabViewModel(Global global, Config config) : base(global)
+ public PrivacyTabViewModel(Global global) : base(global)
{
- _minimalPrivacyLevel = config.PrivacyLevelSome;
- _mediumPrivacyLevel = config.PrivacyLevelFine;
- _strongPrivacyLevel = config.PrivacyLevelStrong;
+ _minimalPrivacyLevel = global.Config.PrivacyLevelSome;
+ _mediumPrivacyLevel = global.Config.PrivacyLevelFine;
+ _strongPrivacyLevel = global.Config.PrivacyLevelStrong;
this.WhenAnyValue(
x => x.MinimalPrivacyLevel,

MODIFY
WalletWasabi.Fluent/ViewModels/Settings/SettingsPageViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/SettingsPageViewModel.cs
@@ -12,7 +12,6 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
public SettingsPageViewModel(NavigationStateViewModel navigationState, Global global) : base(navigationState, NavigationTarget.HomeScreen)
{
- Global = global;
Title = "Settings";
_selectedTab = 0;
@@ -22,20 +21,19 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
this.WhenNavigatedTo(() =>
{
- var config = new Config(global.Config.FilePath);
- config.LoadOrCreateDefaultFile();
+ // TODO: Is it possible to Global.Config is not up to date?
+ // var config = new Config(global.Config.FilePath);
+ // config.LoadOrCreateDefaultFile();
- GeneralTab = new GeneralTabViewModel(Global, config);
- PrivacyTab = new PrivacyTabViewModel(Global, config);
- NetworkTab = new NetworkTabViewModel(Global, config);
- BitcoinTab = new BitcoinTabViewModel(Global, config);
+ GeneralTab = new GeneralTabViewModel(global);
+ PrivacyTab = new PrivacyTabViewModel(global);
+ NetworkTab = new NetworkTabViewModel(global);
+ BitcoinTab = new BitcoinTabViewModel(global);
return Disposable.Empty;
});
}
- public Global Global { get; }
-
public GeneralTabViewModel? GeneralTab { get; set; }
public PrivacyTabViewModel? PrivacyTab { get; set; }
public NetworkTabViewModel? NetworkTab { get; set; }

little simplification