StatusBar background based on network
MODIFY
WalletWasabi.Gui/Controls/StatusBar.xaml
WalletWasabi.Gui/Controls/StatusBar.xaml
<converters:ShouldDisplayValueConverter x:Key="ShouldDisplayValueConverter" />
<converters:PascalToPhraseConverter x:Key="PascalToPhraseConverter" />
<converters:RpcStatusStringConverter x:Key="RpcStatusStringConverter" />
+ <converters:NetworkColorConverter x:Key="NetworkColorConverter"/>
</UserControl.Resources>
<Grid Cursor="{Binding UpdateAvailable, Converter={StaticResource ShowCursorConverter}}"
- Background="{DynamicResource ApplicationAccentBrushLow}">
+ Background="{Binding Network, Converter={StaticResource NetworkColorConverter}}">
<i:Interaction.Behaviors>
<behaviors:CommandOnClickBehavior Command="{Binding UpdateCommand}" />
</i:Interaction.Behaviors>

ADD
WalletWasabi.Gui/Converters/NetworkColorConverter.cs
+using Avalonia;
+using Avalonia.Data.Converters;
+using Avalonia.Media;
+using NBitcoin;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Text;
+using WalletWasabi.Exceptions;
+
+namespace WalletWasabi.Gui.Converters
+{
+ public class NetworkColorConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ 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;
+ }
+ }
+
+ 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
using Avalonia.Threading;
using AvalonStudio.Extensibility;
using AvalonStudio.Shell;
+using NBitcoin;
using NBitcoin.Protocol;
using Nito.AsyncEx;
using ReactiveUI;
@@ -53,6 +54,8 @@ namespace WalletWasabi.Gui.ViewModels
private bool _legalDocsLoading;
+ private Network _network;
+
private volatile bool _disposedValue = false; // To detect redundant calls
public StatusBarViewModel()
@@ -78,6 +81,12 @@ namespace WalletWasabi.Gui.ViewModels
public ReactiveCommand<Unit, Unit> UpdateCommand { get; set; }
+ public Network Network
+ {
+ get => _network;
+ set => this.RaiseAndSetIfChanged(ref _network, value);
+ }
+
public bool UseBitcoinCore
{
get => _useBitcoinCore;
@@ -145,6 +154,7 @@ 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.

StatusBar background based on network