Files
Shrlalgo.RvKits/WPFluent/Controls/BreadcrumbBar/BreadcrumbBar.xaml

116 lines
6.1 KiB
XML

<!--
This Source Code Form is subject to the terms of the MIT License.
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
All Rights Reserved.
-->
<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">
<Style x:Key="DefaultUiBreadcrumbButtonStyle" TargetType="{x:Type ButtonBase}">
<Setter Property="Foreground" Value="{DynamicResource BreadcrumbBarNormalForegroundBrush}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<ContentPresenter
x:Name="Presenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Presenter" Property="TextElement.Foreground" Value="{DynamicResource BreadcrumbBarHoverForegroundBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False" />
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DefaultUiBreadcrumbBarItemStyle" TargetType="{x:Type controls:BreadcrumbBarItem}">
<Setter Property="FontSize" Value="14" />
<Setter Property="FontWeight" Value="DemiBold" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="IconMargin" Value="10, 0, 10, 0" />
<Setter Property="Focusable" Value="False" />
<Setter Property="Icon">
<Setter.Value>
<controls:IconSourceElement>
<controls:IconSourceElement.IconSource>
<controls:SymbolIconSource
FontSize="18.0"
FontWeight="DemiBold"
Symbol="ChevronRight24" />
</controls:IconSourceElement.IconSource>
</controls:IconSourceElement>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:BreadcrumbBarItem}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
x:Name="Button"
Grid.Column="0"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Command="{Binding Path=TemplateButtonCommand, Mode=OneTime, RelativeSource={RelativeSource AncestorType={x:Type controls:BreadcrumbBar}}}"
CommandParameter="{TemplateBinding Content}"
Content="{TemplateBinding Content}"
ContentTemplate="{Binding Path=ItemTemplate, Mode=OneTime, RelativeSource={RelativeSource AncestorType={x:Type controls:BreadcrumbBar}}}"
ContentTemplateSelector="{Binding Path=ItemTemplateSelector, Mode=OneTime, RelativeSource={RelativeSource AncestorType={x:Type controls:BreadcrumbBar}}}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
Style="{StaticResource DefaultUiBreadcrumbButtonStyle}" />
<ContentControl
x:Name="Icon"
Grid.Column="1"
Margin="{TemplateBinding IconMargin}"
Content="{TemplateBinding Icon}"
Focusable="False" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsLast" Value="True">
<Setter TargetName="Button" Property="Foreground" Value="{DynamicResource BreadcrumbBarCurrentNormalForegroundBrush}" />
<Setter TargetName="Button" Property="IsEnabled" Value="False" />
<Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DefaultUiBreadcrumbBarStyle" TargetType="{x:Type controls:BreadcrumbBar}">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel IsItemsHost="True" Orientation="Horizontal" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultUiBreadcrumbBarItemStyle}" TargetType="{x:Type controls:BreadcrumbBarItem}" />
<Style BasedOn="{StaticResource DefaultUiBreadcrumbBarStyle}" TargetType="{x:Type controls:BreadcrumbBar}" />
</ResourceDictionary>