make the badge functional
MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
@@ -38,6 +38,8 @@ public partial class MainViewModel : ViewModelBase
[AutoNotify] private WindowState _windowState;
[AutoNotify] private bool _isOobeBackgroundVisible;
[AutoNotify] private bool _isCoinJoinActive;
+ [AutoNotify] private bool _isNetworkBadgeEnabled;
+ [AutoNotify] private string _networkBadgeName;
public MainViewModel()
{
@@ -153,6 +155,9 @@ public partial class MainViewModel : ViewModelBase
var source = new CompositeSearchItemsSource(new ActionsSource(), new SettingsSource(_settingsPage));
SearchBar = new SearchBarViewModel(source.Changes);
+
+ IsNetworkBadgeEnabled = Services.Config.Network != Network.Main;
+ NetworkBadgeName = IsNetworkBadgeEnabled ? Services.Config.Network.Name : string.Empty;
}
private static StatusChecker CreateTorStatusChecker()

MODIFY
WalletWasabi.Fluent/Views/Shell/TitleBarView.axaml
WalletWasabi.Fluent/Views/Shell/TitleBarView.axaml
<Setter Property="Opacity" Value="0" />
<Setter Property="RenderTransform" Value="translateX(-20px)" />
</Style>
- <Style Selector=":is(Control).NetworkBadge">
+ <Style Selector="Border.NetworkBadge">
<Setter Property="CornerRadius" Value="3" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="Background" Value="{StaticResource ActionColorLight3}" />
+ <Setter Property="Background" Value="Gold" />
</Style>
- <Style Selector=":is(Control).NetworkBadge TextBlock">
+ <Style Selector="Border.NetworkBadge TextBlock">
<Setter Property="Margin" Value="5" />
<Setter Property="FontWeight" Value="Bold" />
+ <Setter Property="Foreground" Value="Black" />
</Style>
</UserControl.Styles>
</DataTemplate>
<DataTemplate x:Key="WindowsAndLinuxLayout">
- <Grid>
+ <Grid DataContext="{Binding $parent.DataContext}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70" />
</DataTemplate>
<DataTemplate x:Key="MacOSLayout">
- <Grid>
+ <Grid DataContext="{Binding $parent.DataContext}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75" />
</Interaction.Behaviors>
<WrapPanel VerticalAlignment="Center">
<ContentControl ContentTemplate="{StaticResource Title}" />
- <Border Classes="NetworkBadge">
- <TextBlock>TestNet</TextBlock>
+ <Border IsVisible="{Binding IsNetworkBadgeEnabled}" Classes="NetworkBadge">
+ <TextBlock Text="{Binding NetworkBadgeName}"/>
</Border>
</WrapPanel>
</Panel>

make the badge functional