Charset selection view
RENAME
WalletWasabi.Fluent/Converters/EnumToStringConverter.cs
WalletWasabi.Fluent/Converters/EnumConverters.cs
using System.Globalization;
using Avalonia.Data.Converters;
using WalletWasabi.Extensions;
+using WalletWasabi.Wallets.PasswordFinder;
namespace WalletWasabi.Fluent.Converters
{
- public static class EnumToStringConverter
+ public static class EnumConverters
{
public static readonly IValueConverter ToFriendlyName =
new FuncValueConverter<Enum, string>(x => x.FriendlyName());
public static readonly IValueConverter ToUpperCase =
new FuncValueConverter<Enum, string>(x => x.ToString().ToUpper(CultureInfo.InvariantCulture));
+
+ public static readonly IValueConverter ToCharset =
+ new FuncValueConverter<Enum, string>(x =>
+ {
+ if (x is Charset c && PasswordFinderHelper.Charsets.ContainsKey(c))
+ {
+ return PasswordFinderHelper.Charsets[c];
+ }
+
+ return "";
+ });
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/Login/PasswordFinder/SearchPasswordViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/PasswordFinder/SearchPasswordViewModel.cs
@@ -17,11 +17,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login.PasswordFinder
Task.Run(() =>
{
- PasswordFinderHelper.TryFind(
- options,
- out var foundPassword,
- SetStatus);
-
+ PasswordFinderHelper.TryFind(options, out var foundPassword, SetStatus);
Navigate().To(new PasswordFinderResultViewModel(foundPassword));
});
}

MODIFY
WalletWasabi.Fluent/Views/Login/PasswordFinder/SelectCharsetView.axaml
WalletWasabi.Fluent/Views/Login/PasswordFinder/SelectCharsetView.axaml
EnableBack="True">
<ListBox Items="{Binding Charsets}"
- SelectedItem="{Binding SelectedCharset}"
- Background="Transparent">
+ SelectedItem="{Binding SelectedCharset}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
- <WrapPanel Orientation="Horizontal" />
+ <StackPanel HorizontalAlignment="Stretch" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
- <Panel Width="150" Height="150"
- Margin="10">
- <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="45" Text="{Binding Converter={x:Static conv:EnumToStringConverter.ToUpperCase}}"/>
- <TextBlock HorizontalAlignment="Center" VerticalAlignment="Bottom" Text="{Binding Converter={x:Static conv:EnumToStringConverter.ToFriendlyName}}"/>
- </Panel>
+ <DockPanel LastChildFill="True">
+ <TextBlock FontSize="45" Width="70" TextAlignment="Center" VerticalAlignment="Center" FontWeight="Light" Text="{Binding Converter={x:Static conv:EnumConverters.ToUpperCase}}" DockPanel.Dock="Left"/>
+ <TextBlock FontSize="45" Text="-" DockPanel.Dock="Left" VerticalAlignment="Center"/>
+ <DockPanel DockPanel.Dock="Left" Margin="10 0 0 0" LastChildFill="True">
+ <TextBlock DockPanel.Dock="Bottom" TextWrapping="Wrap" Opacity="0.6" FontSize="12" FontWeight="Light" Text="{Binding Converter={x:Static conv:EnumConverters.ToCharset}}"/>
+ <TextBlock DockPanel.Dock="Top" FontSize="30" FontWeight="Bold" Text="{Binding Converter={x:Static conv:EnumConverters.ToFriendlyName}}"/>
+ </DockPanel>
+ </DockPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
-
</c:ContentArea>
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/Settings/GeneralSettingsTabView.axaml
WalletWasabi.Fluent/Views/Settings/GeneralSettingsTabView.axaml
<ComboBox HorizontalAlignment="Stretch" Items="{Binding FeeDisplayFormats}" SelectedItem="{Binding SelectedFeeDisplayFormat}">
<ComboBox.ItemTemplate>
<DataTemplate>
- <TextBlock Text="{Binding Converter={x:Static conv:EnumToStringConverter.ToFriendlyName}}" />
+ <TextBlock Text="{Binding Converter={x:Static conv:EnumConverters.ToFriendlyName}}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>

MODIFY
WalletWasabi.Fluent/WalletWasabi.Fluent.csproj
WalletWasabi.Fluent/WalletWasabi.Fluent.csproj
<ItemGroup>
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
</ItemGroup>
-
</Project>

Charset selection view