206 lines
11 KiB
Plaintext
206 lines
11 KiB
Plaintext
|
|
<ResourceDictionary
|
||
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
|
|
xmlns:controls="clr-namespace:WPFluent.Controls">
|
||
|
|
<ResourceDictionary.MergedDictionaries>
|
||
|
|
<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Controls/NavigationView/NavigationViewItemDefaultStyle.xaml" />
|
||
|
|
</ResourceDictionary.MergedDictionaries>
|
||
|
|
|
||
|
|
<ControlTemplate x:Key="LeftMinimalCompactNavigationViewItemTemplate" TargetType="{x:Type controls:NavigationViewItem}">
|
||
|
|
<Grid>
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto" />
|
||
|
|
<RowDefinition Height="Auto" />
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
<Border
|
||
|
|
x:Name="MainBorder"
|
||
|
|
Grid.Row="0"
|
||
|
|
MinWidth="40"
|
||
|
|
MinHeight="40"
|
||
|
|
Margin="0"
|
||
|
|
Padding="0"
|
||
|
|
Background="Transparent"
|
||
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||
|
|
BorderThickness="1"
|
||
|
|
CornerRadius="{TemplateBinding Border.CornerRadius}">
|
||
|
|
<Grid>
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="40" />
|
||
|
|
<ColumnDefinition Width="*" />
|
||
|
|
<ColumnDefinition Width="Auto" />
|
||
|
|
<ColumnDefinition Width="Auto" />
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
|
||
|
|
<Grid Grid.Column="0">
|
||
|
|
<ContentControl
|
||
|
|
x:Name="IconContentPresenter"
|
||
|
|
Margin="-1,0,0,0"
|
||
|
|
HorizontalAlignment="Center"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
Content="{TemplateBinding Icon}"
|
||
|
|
Foreground="{DynamicResource NavigationViewItemForeground}" />
|
||
|
|
</Grid>
|
||
|
|
|
||
|
|
<Rectangle
|
||
|
|
x:Name="ActiveRectangle"
|
||
|
|
Grid.Column="0"
|
||
|
|
Width="3"
|
||
|
|
Height="16"
|
||
|
|
Margin="0"
|
||
|
|
HorizontalAlignment="Left"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
Fill="{DynamicResource NavigationViewSelectionIndicatorForeground}"
|
||
|
|
Opacity="0.0"
|
||
|
|
RadiusX="2"
|
||
|
|
RadiusY="2" />
|
||
|
|
|
||
|
|
<ContentPresenter
|
||
|
|
x:Name="ElementContentPresenter"
|
||
|
|
Grid.Column="1"
|
||
|
|
HorizontalAlignment="Left"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
Content="{TemplateBinding Content}"
|
||
|
|
TextElement.FontSize="14"
|
||
|
|
TextElement.Foreground="{TemplateBinding Foreground}" />
|
||
|
|
|
||
|
|
<ContentPresenter
|
||
|
|
x:Name="PART_InfoBadge"
|
||
|
|
Grid.Column="2"
|
||
|
|
Margin="0"
|
||
|
|
Content="{TemplateBinding InfoBadge}" />
|
||
|
|
|
||
|
|
<controls:SymbolIcon
|
||
|
|
x:Name="ChevronIcon"
|
||
|
|
Grid.Column="3"
|
||
|
|
Symbol="ChevronDown24"
|
||
|
|
Visibility="Collapsed" />
|
||
|
|
</Grid>
|
||
|
|
</Border>
|
||
|
|
<ItemsControl
|
||
|
|
Grid.Row="1"
|
||
|
|
Focusable="False"
|
||
|
|
ItemsSource="{TemplateBinding MenuItemsSource}"
|
||
|
|
KeyboardNavigation.DirectionalNavigation="Contained"
|
||
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||
|
|
ScrollViewer.VerticalScrollBarVisibility="Disabled">
|
||
|
|
<ItemsControl.ItemsPanel>
|
||
|
|
<ItemsPanelTemplate>
|
||
|
|
<StackPanel Margin="0" IsItemsHost="True" />
|
||
|
|
</ItemsPanelTemplate>
|
||
|
|
</ItemsControl.ItemsPanel>
|
||
|
|
<ItemsControl.Resources>
|
||
|
|
<Style BasedOn="{StaticResource NavigationViewItemDefaultStyle}" TargetType="{x:Type controls:NavigationViewItem}">
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type controls:NavigationViewItem}">
|
||
|
|
<Border
|
||
|
|
x:Name="MainBorder"
|
||
|
|
Grid.Row="0"
|
||
|
|
MinHeight="40"
|
||
|
|
Margin="0"
|
||
|
|
Padding="0"
|
||
|
|
Background="Transparent"
|
||
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||
|
|
BorderThickness="1"
|
||
|
|
CornerRadius="{TemplateBinding Border.CornerRadius}">
|
||
|
|
<Grid>
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="40" />
|
||
|
|
<ColumnDefinition Width="*" MinWidth="180" />
|
||
|
|
<ColumnDefinition Width="Auto" />
|
||
|
|
<ColumnDefinition Width="Auto" />
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
|
||
|
|
<Grid Grid.Column="0">
|
||
|
|
<ContentPresenter
|
||
|
|
x:Name="IconContentPresenter"
|
||
|
|
Margin="-1,0,0,0"
|
||
|
|
HorizontalAlignment="Center"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
Content="{TemplateBinding Icon}"
|
||
|
|
TextElement.Foreground="{DynamicResource NavigationViewItemForeground}" />
|
||
|
|
</Grid>
|
||
|
|
|
||
|
|
<Rectangle
|
||
|
|
x:Name="ActiveRectangle"
|
||
|
|
Grid.Column="0"
|
||
|
|
Width="3"
|
||
|
|
Height="16"
|
||
|
|
Margin="0"
|
||
|
|
HorizontalAlignment="Left"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
Fill="{DynamicResource NavigationViewSelectionIndicatorForeground}"
|
||
|
|
Opacity="0.0"
|
||
|
|
RadiusX="2"
|
||
|
|
RadiusY="2" />
|
||
|
|
|
||
|
|
<ContentPresenter
|
||
|
|
x:Name="ElementContentPresenter"
|
||
|
|
Grid.Column="1"
|
||
|
|
HorizontalAlignment="Left"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
Content="{TemplateBinding Content}"
|
||
|
|
TextElement.FontSize="14"
|
||
|
|
TextElement.Foreground="{TemplateBinding Foreground}" />
|
||
|
|
|
||
|
|
<ContentPresenter
|
||
|
|
x:Name="PART_InfoBadge"
|
||
|
|
Grid.Column="2"
|
||
|
|
Margin="0"
|
||
|
|
Content="{TemplateBinding InfoBadge}" />
|
||
|
|
|
||
|
|
<controls:SymbolIcon
|
||
|
|
x:Name="ChevronIcon"
|
||
|
|
Grid.Column="3"
|
||
|
|
Symbol="ChevronDown24"
|
||
|
|
Visibility="Collapsed" />
|
||
|
|
</Grid>
|
||
|
|
</Border>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
</ItemsControl.Resources>
|
||
|
|
</ItemsControl>
|
||
|
|
</Grid>
|
||
|
|
<ControlTemplate.Triggers>
|
||
|
|
<Trigger Property="IsPaneOpen" Value="True">
|
||
|
|
<Setter TargetName="PART_InfoBadge" Property="Grid.Column" Value="2" />
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="IsPaneOpen" Value="False">
|
||
|
|
<Setter TargetName="PART_InfoBadge" Property="Grid.Column" Value="0" />
|
||
|
|
<Setter TargetName="PART_InfoBadge" Property="VerticalAlignment" Value="Top" />
|
||
|
|
<Setter TargetName="PART_InfoBadge" Property="HorizontalAlignment" Value="Right" />
|
||
|
|
</Trigger>
|
||
|
|
|
||
|
|
<Trigger Property="HasMenuItems" Value="True">
|
||
|
|
<Setter TargetName="ChevronIcon" Property="Visibility" Value="Visible" />
|
||
|
|
<Setter TargetName="ChevronIcon" Property="Margin" Value="8,0,8,0" />
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="IsActive" Value="True">
|
||
|
|
<Setter TargetName="ActiveRectangle" Property="Opacity" Value="1.0" />
|
||
|
|
<Setter TargetName="MainBorder" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundSelected}" />
|
||
|
|
<!--<Setter TargetName="IconContentPresenter" Property="Filled" Value="True" /> -->
|
||
|
|
<!--<Setter TargetName="IconContentPresenter" Property="Foreground" Value="{DynamicResource NavigationViewSelectionIndicatorForeground}" />-->
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="Icon" Value="{x:Null}">
|
||
|
|
<Setter TargetName="IconContentPresenter" Property="Visibility" Value="Collapsed" />
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="IsMouseOver" Value="True">
|
||
|
|
<Setter TargetName="MainBorder" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundPointerOver}" />
|
||
|
|
</Trigger>
|
||
|
|
<MultiTrigger>
|
||
|
|
<MultiTrigger.Conditions>
|
||
|
|
<Condition Property="IsMouseOver" Value="True" />
|
||
|
|
<Condition Property="IsActive" Value="False" />
|
||
|
|
</MultiTrigger.Conditions>
|
||
|
|
<MultiTrigger.Setters>
|
||
|
|
<Setter TargetName="IconContentPresenter" Property="Foreground" Value="{DynamicResource NavigationViewItemForeground}" />
|
||
|
|
<Setter TargetName="ElementContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForeground}" />
|
||
|
|
</MultiTrigger.Setters>
|
||
|
|
</MultiTrigger>
|
||
|
|
</ControlTemplate.Triggers>
|
||
|
|
</ControlTemplate>
|
||
|
|
|
||
|
|
</ResourceDictionary>
|