nav bar selection work.
MODIFY
WalletWasabi.Fluent/Controls/NavBarItem.xaml
WalletWasabi.Fluent/Controls/NavBarItem.xaml
</Style>
<!-- Selected State -->
- <Style Selector="c|NavBarItem:selected /template/ Rectangle#PressedBackground">
- <Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}"/>
+ <Style Selector="c|NavBarItem:selected /template/ Border">
+ <Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColor}"/>
</Style>
<Style Selector="c|NavBarItem:selected /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/>
</Style>
<!-- Selected PointerOver State -->
- <Style Selector="c|NavBarItem:selected:pointerover /template/ Rectangle#PressedBackground">
- <Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}"/>
+ <Style Selector="c|NavBarItem:selected:pointerover /template/ Border">
+ <Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColor}"/>
</Style>
<Style Selector="c|NavBarItem:selected:pointerover /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/>
</Style>
<!-- Selected Pressed State -->
- <Style Selector="c|NavBarItem:selected:pressed /template/ Rectangle#PressedBackground">
- <Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListAccentHighBrush}"/>
+ <Style Selector="c|NavBarItem:selected:pressed /template/ Border">
+ <Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColorLight1}"/>
</Style>
<Style Selector="c|NavBarItem:selected:pressed /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/>

MODIFY
WalletWasabi.Fluent/ViewModels/NavBarViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBarViewModel.cs
@@ -103,11 +103,21 @@ namespace WalletWasabi.Fluent.ViewModels
get { return _selectedItem; }
set
{
+ if (_selectedItem is { })
+ {
+ _selectedItem.IsSelected = false;
+ }
+
_selectedItem = null;
this.RaisePropertyChanged();
this.RaiseAndSetIfChanged(ref _selectedItem, value);
+
+ if(_selectedItem is { })
+ {
+ _selectedItem.IsSelected = true;
+ }
}
}

MODIFY
WalletWasabi.Fluent/Views/NavBar.axaml
WalletWasabi.Fluent/Views/NavBar.axaml
<Style Selector="ListBoxItem">
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
+ <Setter Property="HorizontalContentAlignment" Value="Stretch" />
+ </Style>
+ <Style Selector="ListBoxItem:pointerover /template/ Rectangle#PressedBackground, ListBoxItem:selected /template/ Rectangle#PressedBackground">
+ <Setter Property="Fill" Value="Transparent"/>
</Style>
<Style Selector="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
<Setter Property="BorderThickness" Value="0" />
</Style>
+ <Style Selector="TreeViewItem /template/ Border#PART_LayoutRoot:pointerover, TreeViewItem:selected /template/ Border#PART_LayoutRoot">
+ <Setter Property="Background" Value="Transparent" />
+ </Style>
<Style Selector="c|NavBarItem TextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</UserControl.Styles>
<UserControl.DataTemplates>
<DataTemplate DataType="vm:HomePageViewModel">
- <c:NavBarItem>
+ <c:NavBarItem IsSelected="{Binding IsSelected}">
<StackPanel Orientation="Horizontal" Spacing="20">
<PathIcon Data="{StaticResource home_regular}" />
<TextBlock Text="Home" />
</c:NavBarItem>
</DataTemplate>
<DataTemplate DataType="vm:SettingsPageViewModel">
- <c:NavBarItem>
+ <c:NavBarItem IsSelected="{Binding IsSelected}">
<StackPanel Orientation="Horizontal" Spacing="20">
<PathIcon Data="{StaticResource settings_regular}" />
<TextBlock Text="Settings" />
</c:NavBarItem>
</DataTemplate>
<DataTemplate DataType="vm:AddWalletPageViewModel">
- <c:NavBarItem>
+ <c:NavBarItem IsSelected="{Binding IsSelected}">
<StackPanel Orientation="Horizontal" Spacing="20">
<PathIcon Data="{StaticResource add_circle_regular}" />
<TextBlock Text="Add Wallet" />
</c:NavBarItem>
</DataTemplate>
<TreeDataTemplate DataType="vm:ClosedWalletViewModel" ItemsSource="{Binding Items}">
- <c:NavBarItem>
+ <c:NavBarItem IsSelected="{Binding IsSelected}">
<StackPanel Orientation="Horizontal" Spacing="20">
<PathIcon Data="{StaticResource web_asset_regular}" />
<TextBlock Text="{Binding Title}" />

nav bar selection work.