更新
This commit is contained in:
@@ -1,49 +1,37 @@
|
||||
<!--
|
||||
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.
|
||||
|
||||
Based on Microsoft XAML for Win UI
|
||||
Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
-->
|
||||
|
||||
<ResourceDictionary
|
||||
<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"
|
||||
xmlns:markup="clr-namespace:WPFluent.Markup">
|
||||
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<!--<ResourceDictionary Source="/WPFluent;component/Themes/Light.xaml"/>-->
|
||||
<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Controls/Button/Button.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Thickness x:Key="ButtonChevronIconMargin">8,0,0,0</Thickness>
|
||||
|
||||
<Style
|
||||
x:Key="DefaultUiDropDownButtonStyle"
|
||||
BasedOn="{StaticResource DefaultUiButtonStyle}"
|
||||
TargetType="{x:Type controls:DropDownButton}">
|
||||
TargetType="{x:Type controls:DropDownButton}"
|
||||
x:Key="DefaultUiDropDownButtonStyle">
|
||||
<Setter Property="IsDropDownOpen" Value="False" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:DropDownButton}">
|
||||
<Border
|
||||
x:Name="ContentBorder"
|
||||
Grid.Row="0"
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
MinWidth="{TemplateBinding MinWidth}"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Height="{TemplateBinding Height}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
MinWidth="{TemplateBinding MinWidth}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
Width="{TemplateBinding Width}"
|
||||
x:Name="ContentBorder">
|
||||
<Border
|
||||
Padding="{TemplateBinding Padding}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@@ -51,22 +39,22 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter
|
||||
x:Name="ControlIcon"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource ButtonIconMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Icon}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Focusable="False"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource ButtonIconMargin}"
|
||||
TextElement.FontSize="{TemplateBinding FontSize}"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}" />
|
||||
TextElement.Foreground="{TemplateBinding Foreground}"
|
||||
VerticalAlignment="Center"
|
||||
x:Name="ControlIcon" />
|
||||
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Content}"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}" />
|
||||
Grid.Column="1"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}"
|
||||
VerticalAlignment="Center"
|
||||
x:Name="ContentPresenter" />
|
||||
|
||||
<Grid Grid.Column="2" Margin="{StaticResource ButtonChevronIconMargin}">
|
||||
<controls:SymbolIcon FontSize="10" Symbol="ChevronDown24" />
|
||||
@@ -80,33 +68,33 @@
|
||||
<Condition Property="IsMouseOver" Value="True" />
|
||||
<Condition Property="IsPressed" Value="False" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="ContentBorder" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<Setter Property="Background" TargetName="ContentBorder" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="True" />
|
||||
<Condition Property="IsPressed" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="ContentBorder" Property="Background" Value="{Binding PressedBackground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{Binding PressedBorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{Binding PressedForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<Setter TargetName="ControlIcon" Property="TextElement.Foreground" Value="{Binding PressedForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<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}}" />
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ControlFillColorDisabledBrush}" />
|
||||
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
|
||||
<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}" />
|
||||
</Trigger>
|
||||
<Trigger Property="Content" Value="{x:Null}">
|
||||
<Setter TargetName="ControlIcon" Property="Margin" Value="0" />
|
||||
<Setter Property="Margin" TargetName="ControlIcon" Value="0" />
|
||||
</Trigger>
|
||||
<Trigger Property="Content" Value="">
|
||||
<Setter TargetName="ControlIcon" Property="Margin" Value="0" />
|
||||
<Setter Property="Margin" TargetName="ControlIcon" Value="0" />
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter TargetName="ControlIcon" Property="Margin" Value="0" />
|
||||
<Setter TargetName="ControlIcon" Property="Visibility" Value="Collapsed" />
|
||||
<Setter Property="Margin" TargetName="ControlIcon" Value="0" />
|
||||
<Setter Property="Visibility" TargetName="ControlIcon" Value="Collapsed" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
Reference in New Issue
Block a user