2025-07-11 09:20:23 +08:00
|
|
|
<ResourceDictionary
|
2025-02-10 20:53:40 +08:00
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:controls="clr-namespace:WPFluent.Controls"
|
2025-07-11 09:20:23 +08:00
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
2025-02-10 20:53:40 +08:00
|
|
|
<ResourceDictionary.MergedDictionaries>
|
2025-07-11 09:20:23 +08:00
|
|
|
<!--<ResourceDictionary Source="/WPFluent;component/Themes/Light.xaml"/>-->
|
2025-02-10 20:53:40 +08:00
|
|
|
<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Controls/Button/Button.xaml" />
|
|
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
|
|
|
|
|
|
<Thickness x:Key="ButtonChevronIconMargin">8,0,0,0</Thickness>
|
|
|
|
|
|
|
|
|
|
<Style
|
|
|
|
|
BasedOn="{StaticResource DefaultUiButtonStyle}"
|
2025-07-11 09:20:23 +08:00
|
|
|
TargetType="{x:Type controls:DropDownButton}"
|
|
|
|
|
x:Key="DefaultUiDropDownButtonStyle">
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="IsDropDownOpen" Value="False" />
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type controls:DropDownButton}">
|
|
|
|
|
<Border
|
2025-07-11 09:20:23 +08:00
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
2025-02-10 20:53:40 +08:00
|
|
|
Height="{TemplateBinding Height}"
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
2025-07-11 09:20:23 +08:00
|
|
|
MinHeight="{TemplateBinding MinHeight}"
|
|
|
|
|
MinWidth="{TemplateBinding MinWidth}"
|
2025-02-10 20:53:40 +08:00
|
|
|
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
2025-07-11 09:20:23 +08:00
|
|
|
Width="{TemplateBinding Width}"
|
|
|
|
|
x:Name="ContentBorder">
|
2025-02-10 20:53:40 +08:00
|
|
|
<Border
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2025-07-11 09:20:23 +08:00
|
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
|
|
|
Padding="{TemplateBinding Padding}">
|
2025-02-10 20:53:40 +08:00
|
|
|
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<ContentPresenter
|
|
|
|
|
Content="{TemplateBinding Icon}"
|
|
|
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
|
|
|
Focusable="False"
|
2025-07-11 09:20:23 +08:00
|
|
|
Grid.Column="0"
|
|
|
|
|
Margin="{StaticResource ButtonIconMargin}"
|
2025-02-10 20:53:40 +08:00
|
|
|
TextElement.FontSize="{TemplateBinding FontSize}"
|
2025-07-11 09:20:23 +08:00
|
|
|
TextElement.Foreground="{TemplateBinding Foreground}"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
x:Name="ControlIcon" />
|
2025-02-10 20:53:40 +08:00
|
|
|
|
|
|
|
|
<ContentPresenter
|
2025-07-11 09:20:23 +08:00
|
|
|
Content="{TemplateBinding Content}"
|
2025-02-10 20:53:40 +08:00
|
|
|
Grid.Column="1"
|
2025-07-11 09:20:23 +08:00
|
|
|
TextElement.Foreground="{TemplateBinding Foreground}"
|
2025-02-10 20:53:40 +08:00
|
|
|
VerticalAlignment="Center"
|
2025-07-11 09:20:23 +08:00
|
|
|
x:Name="ContentPresenter" />
|
2025-02-10 20:53:40 +08:00
|
|
|
|
|
|
|
|
<Grid Grid.Column="2" Margin="{StaticResource ButtonChevronIconMargin}">
|
|
|
|
|
<controls:SymbolIcon FontSize="10" Symbol="ChevronDown24" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
</Border>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsMouseOver" Value="True" />
|
|
|
|
|
<Condition Property="IsPressed" Value="False" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Background" TargetName="ContentBorder" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
|
|
|
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsMouseOver" Value="True" />
|
|
|
|
|
<Condition Property="IsPressed" Value="True" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Background" TargetName="ContentBorder" Value="{Binding PressedBackground, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
|
|
|
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{Binding PressedBorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
|
|
|
<Setter Property="TextElement.Foreground" TargetName="ContentPresenter" Value="{Binding PressedForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
|
|
|
<Setter Property="TextElement.Foreground" TargetName="ControlIcon" Value="{Binding PressedForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorDisabledBrush}" />
|
|
|
|
|
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
|
|
|
|
|
<Setter Property="TextElement.Foreground" TargetName="ContentPresenter" Value="{DynamicResource TextFillColorDisabledBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Content" Value="{x:Null}">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Margin" TargetName="ControlIcon" Value="0" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Content" Value="">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Margin" TargetName="ControlIcon" Value="0" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Icon" Value="{x:Null}">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Margin" TargetName="ControlIcon" Value="0" />
|
|
|
|
|
<Setter Property="Visibility" TargetName="ControlIcon" Value="Collapsed" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<Style BasedOn="{StaticResource DefaultUiDropDownButtonStyle}" TargetType="{x:Type controls:DropDownButton}" />
|
|
|
|
|
|
|
|
|
|
</ResourceDictionary>
|