Add save trigger on non string properties
MODIFY
WalletWasabi.Fluent/ViewModels/Settings/SettingsPageViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/SettingsPageViewModel.cs
@@ -36,16 +36,6 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
// TODO: Restart wasabi message
IsModified = !Global.Config.AreDeepEqual(config);
- // TODO: trigger save
- // this.WhenAnyValue(
- // x => x.Network,
- // x => x.UseTor,
- // x => x.TerminateTorOnExit,
- // x => x.StartLocalBitcoinCoreOnStartup,
- // x => x.StopLocalBitcoinCoreOnShutdown)
- // .ObserveOn(RxApp.TaskpoolScheduler)
- // .Subscribe(_ => Save());
-
// TextBoxLostFocusCommand = ReactiveCommand.Create(Save);
// Observable
@@ -61,7 +51,6 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
public NetworkTabViewModel NetworkTab { get; }
public BitcoinTabViewModel BitcoinTab { get; }
-
public ReactiveCommand<Unit, Unit> TextBoxLostFocusCommand { get; }
public bool IsModified

MODIFY
WalletWasabi.Fluent/ViewModels/Settings/SettingsViewModelBase.cs
WalletWasabi.Fluent/ViewModels/Settings/SettingsViewModelBase.cs
@@ -11,13 +11,13 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
{
public abstract class SettingsViewModelBase : ViewModelBase
{
- public Global Global { get; }
-
protected SettingsViewModelBase(Global global)
{
Global = global;
}
+ public Global Global { get; }
+
private static object ConfigLock { get; } = new object();
protected void Save()
@@ -31,7 +31,8 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
{
config.LoadFile();
EditConfigOnSave(config);
- config.ToFile();
+ // config.ToFile();
+
// IsModified = !Global.Config.AreDeepEqual(config);
}
});

Add save trigger on non string properties