Skip to content

Commit 70f0123

Browse files
authored
[STYLE] Update top NavigationView Resources (#277)
* update navigationview top pane resources fix #261 updated navigationview resources from NavigationView_themeresources.xaml * Update NavigationView.xaml updated top navigation view item styles
1 parent 502f3c8 commit 70f0123

4 files changed

Lines changed: 46 additions & 41 deletions

File tree

source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/NavigationView/NavigationView.xaml

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -308,18 +308,19 @@
308308
<RowDefinition x:Name="IconRow" Height="Auto" />
309309
<RowDefinition Height="*" />
310310
</Grid.RowDefinitions>
311-
<ui:ContentPresenterEx
312-
x:Name="IconBox"
313-
Grid.Row="1"
314-
Grid.Column="1"
315-
Height="16"
316-
Width="16"
317-
Margin="0"
318-
HorizontalAlignment="Center"
319-
VerticalAlignment="Center"
320-
Content="{TemplateBinding Icon}"
321-
Foreground="{TemplateBinding Foreground}" ClipToBounds="False">
322-
</ui:ContentPresenterEx>
311+
<Viewbox x:Name="IconBox" Height="16" Width="16" Margin="12,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center">
312+
<ui:ContentPresenterEx
313+
x:Name="Icon"
314+
Grid.Row="1"
315+
Grid.Column="1"
316+
Height="16"
317+
Width="16"
318+
Margin="0"
319+
HorizontalAlignment="Center"
320+
VerticalAlignment="Center"
321+
Content="{TemplateBinding Icon}"
322+
Foreground="{TemplateBinding Foreground}" ClipToBounds="False"/>
323+
</Viewbox>
323324
<ContentPresenter
324325
x:Name="InfoBadgePresenter"
325326
Grid.Column="2"
@@ -352,30 +353,30 @@
352353
<Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PointerOver">
353354
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPointerOver}" />
354355
<Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPointerOver}" />
355-
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
356+
<Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
356357
</Trigger>
357358
<Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Pressed">
358359
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPressed}" />
359360
<Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPressed}" />
360-
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
361+
<Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
361362
</Trigger>
362363
<Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Selected">
363364
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundSelected}" />
364365
<Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelected}" />
365-
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelected}" />
366+
<Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelected}" />
366367
</Trigger>
367368
<Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PointerOverSelected">
368369
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundSelectedPointerOver}" />
369370
<Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelectedPointerOver}" />
370-
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
371+
<Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
371372
</Trigger>
372373
<Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PressedSelected">
373374
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundSelectedPressed}" />
374375
<Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelectedPressed}" />
375-
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
376+
<Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
376377
</Trigger>
377378
<Trigger SourceName="DisabledStatesListener" Property="CurrentStateName" Value="Disabled">
378-
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
379+
<Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
379380
</Trigger>
380381
</ControlTemplate.Triggers>
381382
</ControlTemplate>
@@ -391,6 +392,7 @@
391392
<ControlTemplate TargetType="primitives:NavigationViewItemPresenter">
392393
<Border
393394
x:Name="LayoutRoot"
395+
Margin="{DynamicResource NavigationViewItemButtonMargin}"
394396
Background="{TemplateBinding Background}"
395397
CornerRadius="{TemplateBinding CornerRadius}">
396398
<Border.Resources>
@@ -552,32 +554,35 @@
552554
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPointerOver}" />
553555
<Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPointerOver}" />
554556
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
555-
<Setter Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
557+
<Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
556558
</Trigger>
557559
<Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Pressed">
558560
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPressed}" />
559561
<Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPressed}" />
560562
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
561-
<Setter Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
563+
<Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
562564
</Trigger>
563565
<Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Selected">
564566
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundSelected}" />
565567
<Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelected}" />
566-
<Setter Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelected}" />
568+
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelected}" />
569+
<Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelected}" />
567570
</Trigger>
568571
<Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PointerOverSelected">
569572
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundSelectedPointerOver}" />
570573
<Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelectedPointerOver}" />
571-
<Setter Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelectedPointerOver}" />
574+
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelectedPointerOver}" />
575+
<Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelectedPointerOver}" />
572576
</Trigger>
573577
<Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PressedSelected">
574578
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundSelectedPressed}" />
575579
<Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelectedPressed}" />
576-
<Setter Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelectedPressed}" />
580+
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelectedPressed}" />
581+
<Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelectedPressed}" />
577582
</Trigger>
578583
<Trigger SourceName="DisabledStatesListener" Property="CurrentStateName" Value="Disabled">
579584
<Setter TargetName="IconBox" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
580-
<Setter Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
585+
<Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
581586
</Trigger>
582587
<Trigger SourceName="NavigationViewIconPositionStatesListener" Property="CurrentStateName" Value="IconOnly">
583588
<Setter TargetName="LayoutRoot" Property="Width" Value="36" />

source/iNKORE.UI.WPF.Modern/Themes/Schemes/Dark.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,12 +1767,12 @@
17671767
<m:StaticResource x:Key="TopNavigationViewItemForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" />
17681768
<m:StaticResource x:Key="TopNavigationViewItemForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" />
17691769
<m:StaticResource x:Key="TopNavigationViewItemForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
1770-
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
1771-
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPressed" ResourceKey="SubtleFillColorTransparentBrush" />
1770+
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />
1771+
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" />
17721772
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelected" ResourceKey="SubtleFillColorTransparentBrush" />
17731773
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelected" ResourceKey="TextFillColorPrimaryBrush" />
1774-
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelectedPointerOver" ResourceKey="TextFillColorSecondaryBrush" />
1775-
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelectedPressed" ResourceKey="TextFillColorTertiaryBrush" />
1774+
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelectedPointerOver" ResourceKey="TextFillColorPrimaryBrush" />
1775+
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelectedPressed" ResourceKey="TextFillColorSecondaryBrush" />
17761776
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelectedPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
17771777
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelectedPressed" ResourceKey="SubtleFillColorTransparentBrush" />
17781778

source/iNKORE.UI.WPF.Modern/Themes/Schemes/HighContrast.xaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,21 +1684,21 @@
16841684
<SolidColorBrush x:Key="NavigationViewSelectionIndicatorForeground" Color="{m:ThemeResource SystemColorHighlightTextColor}" />
16851685

16861686
<m:StaticResource x:Key="NavigationViewContentGridBorderBrush" ResourceKey="SystemControlTransparentBrush" />
1687-
1687+
16881688
<m:StaticResource x:Key="TopNavigationViewItemForeground" ResourceKey="NavigationViewItemForeground" />
16891689
<m:StaticResource x:Key="TopNavigationViewItemForegroundPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
16901690
<m:StaticResource x:Key="TopNavigationViewItemForegroundPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
16911691
<m:StaticResource x:Key="TopNavigationViewItemForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
16921692
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelected" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
16931693
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelectedPointerOver" ResourceKey="NavigationViewItemForeground" />
16941694
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelectedPressed" ResourceKey="NavigationViewItemForeground" />
1695-
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPointerOver" ResourceKey="SystemControlHighlightAccentBrush" />
1696-
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPressed" ResourceKey="SystemControlHighlightAccentBrush" />
1697-
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelected" ResourceKey="SystemControlHighlightAccentBrush" />
1698-
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelectedPointerOver" ResourceKey="SystemControlHighlightAccentBrush" />
1699-
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelectedPressed" ResourceKey="SystemControlHighlightAccentBrush" />
1700-
1701-
<m:StaticResource x:Key="TopNavigationViewItemSeparatorForeground" ResourceKey="SystemControlForegroundBaseLowBrush" />
1695+
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPointerOver" ResourceKey="SystemControlHighlightListLowRevealBackgroundBrush" />
1696+
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPressed" ResourceKey="SystemControlHighlightListMediumRevealBackgroundBrush" />
1697+
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelected" ResourceKey="SystemControlHighlightListLowRevealBackgroundBrush" />
1698+
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelectedPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
1699+
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelectedPressed" ResourceKey="SubtleFillColorTransparentBrush" />
1700+
1701+
<m:StaticResource x:Key="TopNavigationViewItemSeparatorForeground" ResourceKey="SystemColorWindowTextColorBrush" />
17021702

17031703
<m:StaticResource x:Key="NavigationViewButtonBackgroundPointerOver" ResourceKey="SystemControlHighlightListLowBrush" />
17041704
<m:StaticResource x:Key="NavigationViewButtonBackgroundPressed" ResourceKey="SystemControlHighlightListMediumBrush" />

source/iNKORE.UI.WPF.Modern/Themes/Schemes/Light.xaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,14 +1785,14 @@
17851785
<m:StaticResource x:Key="TopNavigationViewItemForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" />
17861786
<m:StaticResource x:Key="TopNavigationViewItemForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
17871787
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelected" ResourceKey="TextFillColorPrimaryBrush" />
1788-
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelectedPointerOver" ResourceKey="TextFillColorSecondaryBrush" />
1789-
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelectedPressed" ResourceKey="TextFillColorTertiaryBrush" />
1790-
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
1791-
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPressed" ResourceKey="SubtleFillColorTransparentBrush" />
1788+
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelectedPointerOver" ResourceKey="TextFillColorPrimaryBrush" />
1789+
<m:StaticResource x:Key="TopNavigationViewItemForegroundSelectedPressed" ResourceKey="TextFillColorSecondaryBrush" />
1790+
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />
1791+
<m:StaticResource x:Key="TopNavigationViewItemBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" />
17921792
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelected" ResourceKey="SubtleFillColorTransparentBrush" />
17931793
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelectedPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
17941794
<m:StaticResource x:Key="TopNavigationViewItemBackgroundSelectedPressed" ResourceKey="SubtleFillColorTransparentBrush" />
1795-
1795+
17961796
<m:StaticResource x:Key="TopNavigationViewItemSeparatorForeground" ResourceKey="DividerStrokeColorDefaultBrush" />
17971797

17981798
<m:StaticResource x:Key="NavigationViewButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />

0 commit comments

Comments
 (0)