This commit is contained in:
ShrlAlgo
2025-07-11 09:20:23 +08:00
parent c7b104f44f
commit 4d35cadb56
840 changed files with 102347 additions and 11595 deletions

View File

@@ -1,64 +1,55 @@
<!--
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:controls="clr-namespace:WPFluent.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/WPFluent;component/Themes/Light.xaml"/>
</ResourceDictionary.MergedDictionaries>-->
<Thickness x:Key="ButtonPadding">11,5,11,6</Thickness>
<Thickness x:Key="ButtonBorderThemeThickness">1</Thickness>
<Thickness x:Key="ButtonIconMargin">0,0,8,0</Thickness>
<Style x:Key="DefaultRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
<Style TargetType="{x:Type RepeatButton}" x:Key="DefaultRepeatButtonStyle">
<!-- Universal WPF UI focus -->
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
<!-- Universal WPF UI focus -->
<Setter Property="Background" Value="{DynamicResource ButtonBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
<Setter Property="Border.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
<Setter Property="BorderThickness" Value="{StaticResource ButtonBorderThemeThickness}" />
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Focusable" Value="False" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Border.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Border
x:Name="ContentBorder"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
MinWidth="{TemplateBinding MinWidth}"
MinHeight="{TemplateBinding MinHeight}"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding Border.CornerRadius}">
CornerRadius="{TemplateBinding Border.CornerRadius}"
Height="{TemplateBinding Height}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
MinHeight="{TemplateBinding MinHeight}"
MinWidth="{TemplateBinding MinWidth}"
Padding="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Width="{TemplateBinding Width}"
x:Name="ContentBorder">
<ContentPresenter
x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
TextElement.Foreground="{TemplateBinding Foreground}" />
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
TextElement.Foreground="{TemplateBinding Foreground}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="ContentPresenter" />
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
@@ -66,119 +57,71 @@
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsPressed" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ButtonBackgroundPointerOver}" />
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{DynamicResource ControlElevationBorderBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsPressed" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ButtonBackgroundPressed}" />
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPressed}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundPressed}" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorTertiaryBrush}" />
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
<Setter Property="TextElement.Foreground" TargetName="ContentPresenter" Value="{DynamicResource TextFillColorSecondaryBrush}" />
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ButtonBackgroundDisabled}" />
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushDisabled}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundDisabled}" />
<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>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
<Style x:Key="DefaultButtonStyle" TargetType="{x:Type Button}">
<Style TargetType="{x:Type Button}" x:Key="DefaultButtonStyle">
<!-- Universal WPF UI focus -->
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
<!-- Universal WPF UI focus -->
<Setter Property="Background" Value="{DynamicResource ButtonBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
<Setter Property="Border.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
<Setter Property="BorderThickness" Value="{StaticResource ButtonBorderThemeThickness}" />
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Border.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border
x:Name="ContentBorder"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
MinWidth="{TemplateBinding MinWidth}"
MinHeight="{TemplateBinding MinHeight}"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding Border.CornerRadius}">
CornerRadius="{TemplateBinding Border.CornerRadius}"
Height="{TemplateBinding Height}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
MinHeight="{TemplateBinding MinHeight}"
MinWidth="{TemplateBinding MinWidth}"
Padding="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Width="{TemplateBinding Width}"
x:Name="ContentBorder">
<ContentPresenter
x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
TextElement.Foreground="{TemplateBinding Foreground}" />
<!--
Without the hacky workaround for the themes, we cannot use the freezable VisualState.
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentBorder" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{DynamicResource ButtonBackgroundPointerOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentBorder" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{DynamicResource ControlElevationBorderBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(TextElement.Foreground)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{DynamicResource ButtonForegroundPointerOver}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentBorder" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{DynamicResource ButtonBackgroundPressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentBorder" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{DynamicResource ButtonBorderBrushPressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(TextElement.Foreground)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{DynamicResource ButtonForegroundPressed}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentBorder" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{DynamicResource ButtonBackgroundDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentBorder" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{DynamicResource ButtonBorderBrushDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(TextElement.Foreground)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{DynamicResource ButtonForegroundDisabled}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
-->
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
TextElement.Foreground="{TemplateBinding Foreground}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="ContentPresenter" />
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
@@ -186,69 +129,70 @@
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsPressed" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ButtonBackgroundPointerOver}" />
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{DynamicResource ControlElevationBorderBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsPressed" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ButtonBackgroundPressed}" />
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPressed}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundPressed}" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorTertiaryBrush}" />
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
<Setter Property="TextElement.Foreground" TargetName="ContentPresenter" Value="{DynamicResource TextFillColorSecondaryBrush}" />
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ButtonBackgroundDisabled}" />
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushDisabled}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundDisabled}" />
<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>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
<Style x:Key="DefaultUiButtonStyle" TargetType="{x:Type controls:Button}">
<Style TargetType="{x:Type controls:Button}" x:Key="DefaultUiButtonStyle">
<!-- Universal WPF UI focus -->
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
<!-- Universal WPF UI focus -->
<Setter Property="Background" Value="{DynamicResource ButtonBackground}" />
<Setter Property="MouseOverBackground" Value="{DynamicResource ButtonBackgroundPointerOver}" />
<Setter Property="PressedBackground" Value="{DynamicResource ButtonBackgroundPressed}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
<Setter Property="PressedForeground" Value="{DynamicResource ButtonForegroundPressed}" />
<Setter Property="Appearance" Value="Primary" />
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
<Setter Property="PressedBorderBrush" Value="{DynamicResource ButtonBorderBrushPressed}" />
<Setter Property="MouseOverBorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
<Setter Property="BorderThickness" Value="{StaticResource ButtonBorderThemeThickness}" />
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="Appearance" Value="Secondary" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="MouseOverBackground" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
<Setter Property="MouseOverBorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
<Setter Property="PressedBackground" Value="{DynamicResource ControlFillColorTertiaryBrush}" />
<Setter Property="PressedBorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
<Setter Property="PressedForeground" Value="{DynamicResource TextFillColorSecondaryBrush}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Button}">
<Border
x:Name="ContentBorder"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
MinWidth="{TemplateBinding MinWidth}"
MinHeight="{TemplateBinding MinHeight}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
CornerRadius="{TemplateBinding CornerRadius}"
Height="{TemplateBinding Height}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
MinHeight="{TemplateBinding MinHeight}"
MinWidth="{TemplateBinding MinWidth}"
Padding="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Width="{TemplateBinding Width}"
x:Name="ContentBorder">
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@@ -256,22 +200,22 @@
</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>
</Border>
<ControlTemplate.Triggers>
@@ -280,41 +224,41 @@
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsPressed" Value="False" />
</MultiTrigger.Conditions>
<!--<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter TargetName="ControlIcon" Property="TextElement.Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource TemplatedParent}}" />-->
<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 PressedBackground, 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 ButtonBackgroundDisabled}" />
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushDisabled}" />
<Setter TargetName="ControlIcon" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundDisabled}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundDisabled}" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorDisabledBrush}" />
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
<Setter Property="TextElement.Foreground" TargetName="ControlIcon" Value="{DynamicResource TextFillColorDisabledBrush}" />
<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>
</Setter.Value>
</Setter>
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Style.Triggers>
<!-- TRANSPARENT -->
<Trigger Property="Appearance" Value="Transparent">
@@ -322,154 +266,87 @@
<Setter Property="BorderBrush" Value="Transparent" />
</Trigger>
<!-- PRIMARY -->
<Trigger Property="Appearance" Value="Primary">
<Setter Property="Background" Value="{DynamicResource AccentButtonBackground}" />
<Setter Property="MouseOverBackground" Value="{DynamicResource AccentButtonBackgroundPointerOver}" />
<Setter Property="PressedBackground" Value="{DynamicResource AccentButtonBackgroundPressed}" />
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForeground}" />
<Setter Property="PressedForeground" Value="{DynamicResource AccentButtonForegroundPointerOver}" />
<Setter Property="BorderBrush" Value="{DynamicResource AccentControlElevationBorderBrush}" />
<Setter Property="PressedBorderBrush" Value="{DynamicResource AccentButtonBorderBrushPressed}" />
<!-- Accent -->
<Trigger Property="Appearance" Value="Accent">
<Setter Property="Background" Value="{DynamicResource AccentFillColorDefaultBrush}" />
<!--<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />-->
<Setter Property="Foreground" Value="{DynamicResource TextOnAccentFillColorPrimaryBrush}" />
<Setter Property="MouseOverBackground" Value="{DynamicResource AccentFillColorSecondaryBrush}" />
<Setter Property="PressedBackground" Value="{DynamicResource AccentFillColorTertiaryBrush}" />
<!--<Setter Property="PressedBorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />-->
<Setter Property="PressedForeground" Value="{DynamicResource TextOnAccentFillColorSecondaryBrush}" />
</Trigger>
<!-- DARK -->
<Trigger Property="Appearance" Value="Dark">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource ControlStrongFillColorDark}" />
</Setter.Value>
</Setter>
<!-- Attention -->
<Trigger Property="Appearance" Value="Attention">
<Setter Property="Background" Value="{DynamicResource SystemFillColorAttentionBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextOnAccentFillColorPrimaryBrush}" />
<!--<Setter Property="BorderBrush" Value="{DynamicResource AttentionElevationBorderBrush}" />-->
<Setter Property="MouseOverBackground">
<Setter.Value>
<SolidColorBrush Color="#62000000" />
<SolidColorBrush Color="{DynamicResource SystemFillColorAttention}" Opacity="0.9" />
</Setter.Value>
</Setter>
<Setter Property="PressedBackground">
<Setter.Value>
<SolidColorBrush Color="#52000000" />
</Setter.Value>
</Setter>
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource TextFillColorLightPrimary}" />
</Setter.Value>
</Setter>
<Setter Property="PressedForeground">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource TextFillColorLightSecondary}" />
<SolidColorBrush Color="{DynamicResource SystemFillColorAttention}" Opacity="0.8" />
</Setter.Value>
</Setter>
<Setter Property="PressedForeground" Value="{DynamicResource TextOnAccentFillColorSecondaryBrush}" />
</Trigger>
<!-- LIGHT -->
<Trigger Property="Appearance" Value="Light">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource ControlStrongFillColorLight}" />
</Setter.Value>
</Setter>
<!-- Critical -->
<Trigger Property="Appearance" Value="Critical">
<Setter Property="Background" Value="{DynamicResource SystemFillColorCriticalBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextOnAccentFillColorPrimaryBrush}" />
<!--<Setter Property="BorderBrush" Value="{DynamicResource CriticalElevationBorderBrush}" />-->
<Setter Property="MouseOverBackground">
<Setter.Value>
<SolidColorBrush Color="#D3FFFFFF" />
<SolidColorBrush Color="{DynamicResource SystemFillColorCritical}" Opacity="0.9" />
</Setter.Value>
</Setter>
<Setter Property="PressedBackground">
<Setter.Value>
<SolidColorBrush Color="#F3FFFFFF" />
</Setter.Value>
</Setter>
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource TextFillColorDarkPrimary}" />
</Setter.Value>
</Setter>
<Setter Property="PressedForeground">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource TextFillColorDarkSecondary}" />
<SolidColorBrush Color="{DynamicResource SystemFillColorCritical}" Opacity="0.8" />
</Setter.Value>
</Setter>
<Setter Property="PressedForeground" Value="{DynamicResource TextOnAccentFillColorSecondaryBrush}" />
</Trigger>
<!-- INFO -->
<Trigger Property="Appearance" Value="Info">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource PaletteLightBlueColor}" />
</Setter.Value>
</Setter>
<Setter Property="MouseOverBackground">
<Setter.Value>
<SolidColorBrush Opacity="0.9" Color="{DynamicResource PaletteLightBlueColor}" />
</Setter.Value>
</Setter>
<Setter Property="PressedBackground">
<Setter.Value>
<SolidColorBrush Opacity="0.7" Color="{DynamicResource PaletteLightBlueColor}" />
</Setter.Value>
</Setter>
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource TextFillColorLightPrimary}" />
</Setter.Value>
</Setter>
</Trigger>
<!-- DANGER -->
<Trigger Property="Appearance" Value="Danger">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource PaletteRedColor}" />
</Setter.Value>
</Setter>
<Setter Property="MouseOverBackground">
<Setter.Value>
<SolidColorBrush Opacity="0.9" Color="{DynamicResource PaletteRedColor}" />
</Setter.Value>
</Setter>
<Setter Property="PressedBackground">
<Setter.Value>
<SolidColorBrush Opacity="0.7" Color="{DynamicResource PaletteRedColor}" />
</Setter.Value>
</Setter>
</Trigger>
<!-- SUCCESS -->
<!-- Success -->
<Trigger Property="Appearance" Value="Success">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource PaletteGreenColor}" />
</Setter.Value>
</Setter>
<Setter Property="Background" Value="{DynamicResource SystemFillColorSuccessBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextOnAccentFillColorPrimaryBrush}" />
<!--<Setter Property="BorderBrush" Value="{DynamicResource SuccessElevationBorderBrush}" />-->
<Setter Property="MouseOverBackground">
<Setter.Value>
<SolidColorBrush Opacity="0.9" Color="{DynamicResource PaletteGreenColor}" />
<SolidColorBrush Color="{DynamicResource SystemFillColorSuccess}" Opacity="0.9" />
</Setter.Value>
</Setter>
<Setter Property="PressedBackground">
<Setter.Value>
<SolidColorBrush Opacity="0.7" Color="{DynamicResource PaletteGreenColor}" />
<SolidColorBrush Color="{DynamicResource SystemFillColorSuccess}" Opacity="0.8" />
</Setter.Value>
</Setter>
<Setter Property="PressedForeground" Value="{DynamicResource TextOnAccentFillColorSecondaryBrush}" />
</Trigger>
<!-- CAUTION -->
<!-- Caution -->
<Trigger Property="Appearance" Value="Caution">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource PaletteOrangeColor}" />
</Setter.Value>
</Setter>
<Setter Property="Background" Value="{DynamicResource SystemFillColorCautionBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextOnAccentFillColorPrimaryBrush}" />
<!--<Setter Property="BorderBrush" Value="{DynamicResource CautionElevationBorderBrush}" />-->
<Setter Property="MouseOverBackground">
<Setter.Value>
<SolidColorBrush Opacity="0.9" Color="{DynamicResource PaletteOrangeColor}" />
<SolidColorBrush Color="{DynamicResource SystemFillColorCaution}" Opacity="0.9" />
</Setter.Value>
</Setter>
<Setter Property="PressedBackground">
<Setter.Value>
<SolidColorBrush Opacity="0.7" Color="{DynamicResource PaletteOrangeColor}" />
<SolidColorBrush Color="{DynamicResource SystemFillColorCaution}" Opacity="0.8" />
</Setter.Value>
</Setter>
<Setter Property="PressedForeground" Value="{DynamicResource TextOnAccentFillColorSecondaryBrush}" />
</Trigger>
</Style.Triggers>
</Style>
@@ -478,48 +355,48 @@
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="{x:Type Button}" />
<Style BasedOn="{StaticResource DefaultUiButtonStyle}" TargetType="{x:Type controls:Button}" />
<Style
x:Key="SimpleButtonStyle"
BasedOn="{StaticResource DefaultButtonStyle}"
TargetType="{x:Type Button}">
BasedOn="{StaticResource DefaultButtonStyle}"
TargetType="{x:Type Button}"
x:Key="SimpleButtonStyle">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" />
<!-- <Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" /> -->
<Setter Property="BorderThickness" Value="0" />
<!-- <Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" /> -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border
x:Name="ContentPresenter"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{DynamicResource ControlCornerRadius}"
SnapsToDevicePixels="True">
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{DynamicResource ControlCornerRadius}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True"
x:Name="ContentPresenter">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPointerOver}" />
<Setter TargetName="ContentPresenter" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPointerOver}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundPointerOver}" />
<Setter Property="Background" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
<Setter Property="BorderBrush" TargetName="ContentPresenter" Value="{DynamicResource ControlElevationBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPointerPressed}" />
<Setter TargetName="ContentPresenter" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPressed}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundPressed}" />
<Setter Property="Background" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
<Setter Property="BorderBrush" TargetName="ContentPresenter" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorSecondaryBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ContentPresenter" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushDisabled}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundDisabled}" />
<Setter Property="BorderBrush" TargetName="ContentPresenter" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</ResourceDictionary>