dropdown added
ADD
WalletWasabi.Gui/Converters/FeeDisplayFormatStringConverter.cs
+using Avalonia.Data.Converters;
+using System;
+using System.Globalization;
+using WalletWasabi.Gui.Models;
+using WalletWasabi.Exceptions;
+using System.Collections.Generic;
+
+namespace WalletWasabi.Gui.Converters
+{
+ public class FeeDisplayFormatStringConverter : IValueConverter
+ {
+ private Dictionary<FeeDisplayFormat, string> Texts { get; } = new Dictionary<FeeDisplayFormat, string>
+ {
+ { FeeDisplayFormat.SatoshiPerByte, "sat/vByte" },
+ { FeeDisplayFormat.USD, "USD" },
+ { FeeDisplayFormat.BTC, "BTC" },
+ { FeeDisplayFormat.Percentage, "Percentage" },
+ };
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is FeeDisplayFormat format)
+ {
+ return Texts[format];
+ }
+
+ throw new TypeArgumentException(value, typeof(FeeDisplayFormat), nameof(value));
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}

MODIFY
WalletWasabi.Gui/Tabs/SettingsView.xaml
WalletWasabi.Gui/Tabs/SettingsView.xaml
<converters:BooleanStringConverter x:Key="BooleanStringConverter" />
<converters:NetworkStringConverter x:Key="NetworkStringConverter" />
<converters:VersionStringConverter x:Key="VersionStringConverter" />
+ <converters:FeeDisplayFormatStringConverter x:Key="FeeDisplayFormatStringConverter" />
</UserControl.Resources>
<DockPanel LastChildFill="true">
<StackPanel DockPanel.Dock="Top" IsVisible="{Binding IsModified}" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 5 10 5">
<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 Margin="0 10" Orientation="Vertical" Spacing="5">
+ <TextBlock>Fee Display Format</TextBlock>
+ <DropDown Items="{Binding FeeDisplayFormats}" SelectedItem="{Binding SelectedFeeDisplayFormat}">
+ <DropDown.ItemTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Converter={StaticResource FeeDisplayFormatStringConverter}}" />
+ </DataTemplate>
+ </DropDown.ItemTemplate>
+ </DropDown>
+ </StackPanel>
</StackPanel>
</controls:GroupBox>
<controls:GroupBox Title="Lock Screen" TextBlock.FontSize="16" Padding="10" Margin="0 5 10 5">

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -14,6 +14,7 @@ using System.Reactive.Threading.Tasks;
using System.Threading.Tasks;
using WalletWasabi.Crypto;
using WalletWasabi.Gui.Helpers;
+using WalletWasabi.Gui.Models;
using WalletWasabi.Gui.Validation;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
@@ -41,6 +42,7 @@ namespace WalletWasabi.Gui.Tabs
private string _dustThreshold;
private string _pinBoxText;
private ObservableAsPropertyHelper<bool> _isPinSet;
+ private FeeDisplayFormat _selectedFeeDisplayFormat;
public SettingsViewModel() : base("Settings")
{
@@ -161,6 +163,14 @@ namespace WalletWasabi.Gui.Tabs
.Merge(TextBoxLostFocusCommand.ThrownExceptions)
.ObserveOn(RxApp.TaskpoolScheduler)
.Subscribe(ex => Logger.LogError(ex));
+
+ SelectedFeeDisplayFormat = (Enum.IsDefined(typeof(FeeDisplayFormat), Global.UiConfig.FeeDisplayFormat)) ? (FeeDisplayFormat)Global.UiConfig.FeeDisplayFormat : FeeDisplayFormat.SatoshiPerByte;
+
+ this.WhenAnyValue(x => x.SelectedFeeDisplayFormat)
+ .ObserveOn(RxApp.MainThreadScheduler)
+ .Subscribe(x =>
+ Global.UiConfig.FeeDisplayFormat = (int)x
+ );
}
private bool TabOpened { get; set; }
@@ -282,6 +292,14 @@ namespace WalletWasabi.Gui.Tabs
set => this.RaiseAndSetIfChanged(ref _pinBoxText, value);
}
+ public IEnumerable<FeeDisplayFormat> FeeDisplayFormats => Enum.GetValues(typeof(FeeDisplayFormat)).Cast<FeeDisplayFormat>();
+
+ public FeeDisplayFormat SelectedFeeDisplayFormat
+ {
+ get => _selectedFeeDisplayFormat;
+ set => this.RaiseAndSetIfChanged(ref _selectedFeeDisplayFormat, value);
+ }
+
public override void OnOpen(CompositeDisposable disposables)
{
try

dropdown added