Entire text is yellow if status condition is met
Added todo as StringFormat is not yet supported in Avalonia.
MODIFY
WalletWasabi.Gui/Controls/StatusBar.xaml
WalletWasabi.Gui/Controls/StatusBar.xaml
</DrawingPresenter.Drawing>
</DrawingPresenter>
</Grid>
- <TextBlock>Tor:</TextBlock>
+ <!-- TODO: use StringFormat once its supported by Avalonia -->
+ <TextBlock Foreground="{Binding Tor, ConverterParameter=Tor, Converter={StaticResource StatusColorConvertor}}">Tor:</TextBlock>
<TextBlock Text="{Binding Tor}" Foreground="{Binding Tor, ConverterParameter=Tor, Converter={StaticResource StatusColorConvertor}}" />
</StackPanel>
</DrawingPresenter.Drawing>
</DrawingPresenter>
</Grid>
- <TextBlock>Backend:</TextBlock>
+ <!-- TODO: use StringFormat once its supported by Avalonia -->
+ <TextBlock Foreground="{Binding Backend, ConverterParameter=Backend, Converter={StaticResource StatusColorConvertor}}">Backend:</TextBlock>
<TextBlock Text="{Binding Backend}" Foreground="{Binding Backend, ConverterParameter=Backend, Converter={StaticResource StatusColorConvertor}}" />
</StackPanel>
</DrawingPresenter.Drawing>
</DrawingPresenter>
</Grid>
- <TextBlock>Peers:</TextBlock>
+ <!-- TODO: use StringFormat once its supported by Avalonia -->
+ <TextBlock Foreground="{Binding Peers, ConverterParameter=Peers, Converter={StaticResource StatusColorConvertor}}">Peers:</TextBlock>
<TextBlock Text="{Binding Peers}" Foreground="{Binding Peers, ConverterParameter=Peers, Converter={StaticResource StatusColorConvertor}}" />
</StackPanel>
</DrawingPresenter.Drawing>
</DrawingPresenter>
</Grid>
- <TextBlock>Filters Left:</TextBlock>
+ <!-- TODO: use StringFormat once its supported by Avalonia -->
+ <TextBlock Foreground="{Binding FiltersLeft, ConverterParameter=FiltersLeft, Converter={StaticResource StatusColorConvertor}}">Filters Left:</TextBlock>
<TextBlock Text="{Binding FiltersLeft, Converter={StaticResource FilterLeftValueConverter}}" Foreground="{Binding FiltersLeft, ConverterParameter=FiltersLeft, Converter={StaticResource StatusColorConvertor}}" />
</StackPanel>
</DrawingPresenter.Drawing>
</DrawingPresenter>
</Grid>
- <TextBlock>Blocks Left:</TextBlock>
+ <!-- TODO: use StringFormat once its supported by Avalonia -->
+ <TextBlock Foreground="{Binding BlocksLeft, ConverterParameter=BlocksLeft, Converter={StaticResource StatusColorConvertor}}">Blocks Left:</TextBlock>
<TextBlock Text="{Binding BlocksLeft}" Foreground="{Binding BlocksLeft, ConverterParameter=BlocksLeft, Converter={StaticResource StatusColorConvertor}}" />
</StackPanel>

MODIFY
WalletWasabi.Gui/Converters/StatusColorConvertor.cs
WalletWasabi.Gui/Converters/StatusColorConvertor.cs
@@ -13,7 +13,7 @@ namespace WalletWasabi.Gui.Converters
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- switch (parameter.ToString())
+ switch (parameter?.ToString())
{
case "Tor" when Enum.Parse<TorStatus>(value.ToString()) == TorStatus.NotRunning:
case "Backend" when Enum.Parse<BackendStatus>(value.ToString()) == BackendStatus.NotConnected:

Entire text is yellow if status condition is met

Added todo as StringFormat is not yet supported in Avalonia.