Different colors for networks
MODIFY
WalletWasabi.Gui/Controls/StatusBar.xaml
WalletWasabi.Gui/Controls/StatusBar.xaml
<converters:PascalToPhraseConverter x:Key="PascalToPhraseConverter" />
<converters:RpcStatusStringConverter x:Key="RpcStatusStringConverter" />
<converters:NetworkColorConverter x:Key="NetworkColorConverter"/>
+ <converters:NetworkStringConverter x:Key="NetworkStringConverter"/>
</UserControl.Resources>
<Grid Cursor="{Binding UpdateAvailable, Converter={StaticResource ShowCursorConverter}}"
Background="{Binding Network, Converter={StaticResource NetworkColorConverter}}">
<Grid Height="10" Width="10" IsVisible="{Binding CriticalUpdateAvailable}">
<DrawingPresenter VerticalAlignment="Center" HorizontalAlignment="Center" Drawing="{DynamicResource StatusBar_YellowFlag}" />
</Grid>
+ <TextBlock Text="{Binding Network, Converter={StaticResource NetworkStringConverter}}" />
+ <TextBlock Text="|" />
<TextBlock Text="{Binding Status}" />
</StackPanel>
</DockPanel>

MODIFY
WalletWasabi.Gui/Converters/NetworkColorConverter.cs
WalletWasabi.Gui/Converters/NetworkColorConverter.cs
@@ -12,26 +12,15 @@ namespace WalletWasabi.Gui.Converters
{
public class NetworkColorConverter : IValueConverter
{
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
+ Brush.Parse(value switch
{
- if (value is Network network)
- {
- return network switch
- {
- _ when network == Network.TestNet => Brush.Parse("#AE6200"),
- _ when network == Network.RegTest => Brush.Parse("#CE6200"),
- _ => Application.Current.Resources["ApplicationAccentBrushLow"] as IBrush
- };
- }
- else
- {
- return Application.Current.Resources["ApplicationAccentBrushLow"] as IBrush;
- }
- }
+ Network network when network == Network.TestNet => "#318522",
+ Network network when network == Network.RegTest => "#AE6200",
+ _ => "#007ACC"
+ });
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) =>
throw new NotSupportedException();
}
}
-}

MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -61,6 +61,7 @@ namespace WalletWasabi.Gui.ViewModels
public StatusBarViewModel()
{
Global = Locator.Current.GetService<Global>();
+ Network = Global.Network;
Backend = BackendStatus.NotConnected;
UseTor = false;
Tor = TorStatus.NotRunning;
@@ -154,7 +155,6 @@ namespace WalletWasabi.Gui.ViewModels
public void Initialize(NodesCollection nodes, WasabiSynchronizer synchronizer)
{
Nodes = nodes;
- Network = synchronizer.Network;
Synchronizer = synchronizer;
HashChain = synchronizer.BitcoinStore.SmartHeaderChain;
UseTor = Global.Config.UseTor; // Do not make it dynamic, because if you change this config settings only next time will it activate.

Different colors for networks