Move alert message to the bottom
MODIFY
WalletWasabi.Gui/Tabs/SettingsView.xaml
WalletWasabi.Gui/Tabs/SettingsView.xaml
<controls:GroupBox Title="{Binding Title}" TextBlock.FontSize="30" Padding="30" >
<Grid Classes="content">
<StackPanel Orientation="Vertical" Gap="30">
- <StackPanel>
- <TextBlock FontWeight="Bold">Heads Up! </TextBlock>
- <TextBlock>Changes will be applied after restarting the application.</TextBlock>
- </StackPanel>
-
<controls:GroupBox Title="Bitcoin" TextBlock.FontSize="16" Padding="10" Margin="0 5 10 5">
<StackPanel Margin="0 10">
<TextBlock>Network</TextBlock>
</StackPanel>
</StackPanel>
</controls:GroupBox>
+ <StackPanel IsVisible="{Binding IsDirty}">
+ <TextBlock Classes="warningMessage">Changes will be applied after restarting the application.</TextBlock>
+ </StackPanel>
</StackPanel>
</Grid>
</controls:GroupBox>

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -14,6 +14,8 @@ namespace WalletWasabi.Gui.Tabs
private string _network;
private string _torHost;
private string _torPort;
+ private bool _isDirty;
+ private bool _initialized;
public SettingsViewModel() : base("Settings")
{
@@ -23,7 +25,9 @@ namespace WalletWasabi.Gui.Tabs
? Global.Config.TorSocks5Port.Value.ToString()
: string.Empty;
+ IsDirty = false;
this.WhenAnyValue(x=>x.Network, x=>x.TorHost, x=>x.TorPort).Subscribe(x=>Save());
+ _initialized = true;
}
public IEnumerable<string> Networks
@@ -60,12 +64,21 @@ namespace WalletWasabi.Gui.Tabs
set { this.RaiseAndSetIfChanged(ref _torPort, value); }
}
+ public bool IsDirty
+ {
+ get { return _isDirty; }
+ set { this.RaiseAndSetIfChanged(ref _isDirty, value); }
+ }
+
private void Save()
{
+ if(!_initialized) return;
var isValid = string.IsNullOrEmpty(ValidateTorHost()) &&
string.IsNullOrEmpty(ValidateTorPort());
if(!isValid) return;
+ IsDirty = true;
+
var config = Global.Config.Clone();
config.Network = NBitcoin.Network.GetNetwork(_network);
config.TorHost = _torHost;

Move alert message to the bottom