Boolean-String converter impl in SettingsView
DELETE
WalletWasabi.Gui/Converters/BooleanOnOffConverter.cs
-using Avalonia.Data.Converters;
-using System;
-using System.Globalization;
-
-namespace WalletWasabi.Gui.Converters
-{
- public class BooleanOnOffConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is bool on)
- {
- return on ? "On" : "Off";
- }
- else
- {
- throw new TypeArgumentException(value, typeof(bool), nameof(value));
- }
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
-}

MODIFY
WalletWasabi.Gui/Tabs/SettingsView.xaml
WalletWasabi.Gui/Tabs/SettingsView.xaml
xmlns:controls="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui"
xmlns:converters="clr-namespace:WalletWasabi.Gui.Converters;assembly=WalletWasabi.Gui">
<UserControl.Resources>
- <converters:BooleanOnOffConverter x:Key="BooleanOnOffConverter" />
+ <converters:BooleanStringConverter x:Key="BooleanStringConverter" />
</UserControl.Resources>
<ScrollViewer>
<controls:GroupBox Title="Tor" TextBlock.FontSize="16" Padding="10" Margin="0 5 10 5">
<StackPanel Orientation="Vertical" Spacing="5">
<StackPanel Margin="0 10" Orientation="Horizontal" Spacing="5">
- <ToggleButton IsChecked="{Binding UseTor}" Content="{Binding UseTor, Converter={StaticResource BooleanOnOffConverter}}" Margin="0 0 10 0" />
+ <ToggleButton IsChecked="{Binding UseTor}" Content="{Binding UseTor, Converter={StaticResource BooleanStringConverter}, ConverterParameter=On:Off}" Margin="0 0 10 0" />
<TextBlock VerticalAlignment="Center">Tor can be turned off for debugging.</TextBlock>
</StackPanel>
<StackPanel Margin="0 10" Spacing="5">
<controls:GroupBox Title="UI" TextBlock.FontSize="16" Padding="10" Margin="0 5 10 5">
<StackPanel Orientation="Vertical" Spacing="5">
<StackPanel Margin="0 10" Orientation="Horizontal" Spacing="5">
- <ToggleButton IsChecked="{Binding Autocopy}" Content="{Binding Autocopy, Converter={StaticResource BooleanOnOffConverter}}}" Margin="0 0 10 0" />
+ <ToggleButton IsChecked="{Binding Autocopy}" Content="{Binding Autocopy, Converter={StaticResource BooleanStringConverter}, ConverterParameter=On:Off}" Margin="0 0 10 0" />
<TextBlock VerticalAlignment="Center">Autocopy on Receive and History wallet tabs.</TextBlock>
</StackPanel>
<StackPanel Margin="0 10" Orientation="Horizontal" Spacing="5">
- <ToggleButton IsChecked="{Binding LurkingWifeMode}" Content="{Binding LurkingWifeMode, Converter={StaticResource BooleanOnOffConverter}}}" Margin="0 0 10 0" Command="{Binding LurkingWifeModeCommand}" />
+ <ToggleButton IsChecked="{Binding LurkingWifeMode}" Content="{Binding LurkingWifeMode, Converter={StaticResource BooleanStringConverter}, ConverterParameter=On:Off}" Margin="0 0 10 0" Command="{Binding LurkingWifeModeCommand}" />
<TextBlock VerticalAlignment="Center">Lurking Wife Mode hides sensitive content.</TextBlock>
</StackPanel>
</StackPanel>

Boolean-String converter impl in SettingsView