make it work on pw finder
MODIFY
WalletWasabi.Fluent/Converters/WalletIconConverter.cs
WalletWasabi.Fluent/Converters/WalletIconConverter.cs
using System;
using System.Linq;
-using Avalonia;
using Avalonia.Data.Converters;
using Avalonia.Media.Imaging;
-using Avalonia.Platform;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Wallets;
@@ -66,10 +64,7 @@ namespace WalletWasabi.Fluent.Converters
break;
}
- var assets = AvaloniaLocator.Current.GetService<IAssetLoader>();
-
- using var image = assets.Open(uri);
- return new Bitmap(image);
+ return AssetHelpers.GetBitmapAsset(uri);
}
}
}

ADD
WalletWasabi.Fluent/Helpers/AssetHelpers.cs
+using System;
+using Avalonia;
+using Avalonia.Media.Imaging;
+using Avalonia.Platform;
+
+namespace WalletWasabi.Fluent.Helpers
+{
+ public static class AssetHelpers
+ {
+ public static Bitmap GetBitmapAsset(Uri uri)
+ {
+ var assets = AvaloniaLocator.Current.GetService<IAssetLoader>();
+ using var image = assets.Open(uri);
+ return new Bitmap(image);
+ }
+
+ public static Bitmap GetBitmapAsset(string path)
+ {
+ Uri uri = new(path);
+ return GetBitmapAsset(uri);
+ }
+ }
+}

MODIFY
WalletWasabi.Fluent/ViewModels/Login/PasswordFinder/ContainsNumbersViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/PasswordFinder/ContainsNumbersViewModel.cs
-using System.Reactive;
using System.Windows.Input;
+using Avalonia.Media;
using ReactiveUI;
+using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Wallets.PasswordFinder;
@@ -12,6 +13,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login.PasswordFinder
public ContainsNumbersViewModel(PasswordFinderOptions options)
{
Options = options;
+ Icon = AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/PasswordFinder/{ThemeHelper.CurrentTheme}/numbers.png");
YesCommand = ReactiveCommand.Create(() => SetAnswer(true));
NoCommand = ReactiveCommand.Create(() => SetAnswer(false));
@@ -23,6 +25,8 @@ namespace WalletWasabi.Fluent.ViewModels.Login.PasswordFinder
public ICommand NoCommand { get; }
+ public IImage Icon { get; }
+
private void SetAnswer(bool ans)
{
Options.UseNumbers = ans;

MODIFY
WalletWasabi.Fluent/ViewModels/Login/PasswordFinder/ContainsSymbolsViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/PasswordFinder/ContainsSymbolsViewModel.cs
-using System.Reactive;
using System.Windows.Input;
+using Avalonia.Media;
using ReactiveUI;
+using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Wallets.PasswordFinder;
@@ -12,6 +13,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login.PasswordFinder
public ContainsSymbolsViewModel(PasswordFinderOptions options)
{
Options = options;
+ Icon = AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/PasswordFinder/{ThemeHelper.CurrentTheme}/symbols.png");
YesCommand = ReactiveCommand.Create(() => SetAnswer(true));
NoCommand = ReactiveCommand.Create(() => SetAnswer(false));
@@ -23,6 +25,8 @@ namespace WalletWasabi.Fluent.ViewModels.Login.PasswordFinder
public ICommand NoCommand { get; }
+ public IImage Icon { get; }
+
private void SetAnswer(bool ans)
{
Options.UseSymbols = ans;

MODIFY
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsNumbersView.axaml
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsNumbersView.axaml
<c:QuestionControl Text="Does your password contains numbers?"
YesCommand="{Binding YesCommand}"
NoCommand="{Binding NoCommand}"
- Icon="/Assets/PasswordFinder/numbers.png"
+ Icon="{Binding Icon}"
HighlightButton="Both"/>
</c:ContentArea>
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsSymbolsView.axaml
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsSymbolsView.axaml
<c:QuestionControl Text="Does your password contains special characters?"
YesCommand="{Binding YesCommand}"
NoCommand="{Binding NoCommand}"
- Icon="/Assets/PasswordFinder/symbols.png"
+ Icon="{Binding Icon}"
HighlightButton="Both"/>
</c:ContentArea>
</UserControl>

make it work on pw finder