use icon converter.
ADD
WalletWasabi.Fluent/Converters/NavBarIconConverter.cs
+using Avalonia;
+using Avalonia.Data.Converters;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Text;
+using WalletWasabi.Fluent.ViewModels;
+
+namespace WalletWasabi.Fluent.Converters
+{
+ public class NavBarIconConverter : IValueConverter
+ {
+ private NavBarIconConverter()
+ {
+
+ }
+
+ public static readonly NavBarIconConverter Instance = new NavBarIconConverter();
+
+ object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if(value is NavBarItemViewModel nvivm)
+ {
+ if (Application.Current.Styles.TryGetResource(nvivm.IconName, out object resource))
+ {
+ return resource;
+ }
+ }
+
+ return null;
+ }
+
+ object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}

MODIFY
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
@@ -8,5 +8,7 @@ namespace WalletWasabi.Fluent.ViewModels
{
Title = "Add Wallet";
}
+
+ public override string IconName => "add_circle_regular";
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/ClosedWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/ClosedWalletViewModel.cs
@@ -13,6 +13,8 @@ namespace WalletWasabi.Fluent.ViewModels
{
public class ClosedWalletViewModel : WalletViewModelBase
{
+ public override string IconName => "web_asset_regular";
+
private ObservableCollection<NavBarItemViewModel> _items;
protected ClosedWalletViewModel(IScreen screen, WalletManager walletManager, Wallet wallet) : base(screen, wallet)

MODIFY
WalletWasabi.Fluent/ViewModels/HomePageViewModel.cs
WalletWasabi.Fluent/ViewModels/HomePageViewModel.cs
@@ -4,6 +4,8 @@ namespace WalletWasabi.Fluent.ViewModels
{
public class HomePageViewModel : NavBarItemViewModel
{
+ public override string IconName => "home_regular";
+
public HomePageViewModel(IScreen screen) : base(screen)
{
Title = "Home";

MODIFY
WalletWasabi.Fluent/ViewModels/NavBarItemViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBarItemViewModel.cs
@@ -14,6 +14,8 @@ namespace WalletWasabi.Fluent.ViewModels
HostScreen = screen;
}
+ public abstract string IconName { get; }
+
public string UrlPathSegment { get; } = Guid.NewGuid().ToString().Substring(0, 5);
public IScreen HostScreen { get; }

MODIFY
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
@@ -5,6 +5,8 @@ namespace WalletWasabi.Fluent.ViewModels
{
public class SettingsPageViewModel : NavBarItemViewModel
{
+ public override string IconName => "settings_regular";
+
public SettingsPageViewModel(IScreen screen) : base(screen)
{
Title = "Settings";

MODIFY
WalletWasabi.Fluent/ViewModels/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletViewModel.cs
@@ -15,6 +15,8 @@ namespace WalletWasabi.Fluent.ViewModels
{
public class WalletViewModel : WalletViewModelBase
{
+ public override string IconName => "web_asset_regular";
+
private ObservableCollection<ViewModelBase> _actions;
protected WalletViewModel(IScreen screen, UiConfig uiConfig, Wallet wallet) : base(screen, wallet)

MODIFY
WalletWasabi.Fluent/Views/NavBar.axaml
WalletWasabi.Fluent/Views/NavBar.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:WalletWasabi.Fluent.ViewModels"
xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
+ xmlns:conv="clr-namespace:WalletWasabi.Fluent.Converters"
xmlns:behaviors="clr-namespace:WalletWasabi.Fluent.Behaviors;assembly=WalletWasabi.Fluent"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="WalletWasabi.Fluent.Views.NavBar" UseLayoutRounding="False">
<DataTemplate>
<Panel>
<Panel Width="45" HorizontalAlignment="Left">
- <PathIcon HorizontalAlignment="Left" Data="{StaticResource add_circle_regular}" />
+ <PathIcon HorizontalAlignment="Left">
+ <PathIcon.Data>
+ <Binding Path="." Converter="{x:Static conv:NavBarIconConverter.Instance}" />
+ </PathIcon.Data>
+ </PathIcon>
</Panel>
<TextBlock Text="{Binding Title}" Margin="35 0 0 0" />
</Panel>
<TreeDataTemplate ItemsSource="{Binding Items}">
<Panel>
<Panel Width="45" HorizontalAlignment="Left">
- <PathIcon HorizontalAlignment="Left" Data="{StaticResource add_circle_regular}" />
+ <PathIcon HorizontalAlignment="Left">
+ <PathIcon.Data>
+ <Binding Path="." Converter="{x:Static conv:NavBarIconConverter.Instance}" />
+ </PathIcon.Data>
+ </PathIcon>
</Panel>
<TextBlock Text="{Binding Title}" Margin="35 0 0 0" />
</Panel>

use icon converter.