2025-07-31 20:12:24 +08:00
|
|
|
<ResourceDictionary
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2025-08-20 12:10:13 +08:00
|
|
|
xmlns:assists="clr-namespace:NeumUI.Assists"
|
|
|
|
|
xmlns:sve="clr-namespace:NeumUI.Effects"
|
2025-07-31 20:12:24 +08:00
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
|
<!-- 扁平默认按钮 -->
|
|
|
|
|
<Style TargetType="{x:Type Button}" x:Key="FlattenButton">
|
2025-08-20 12:10:13 +08:00
|
|
|
<Setter Property="assists:ControlAssist.CornerRadius" Value="4" />
|
2025-08-12 23:08:54 +08:00
|
|
|
<Setter Property="assists:ShadingAssist.DisabledForeground" Value="{DynamicResource TextDisabledBrush}" />
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
2025-07-31 20:12:24 +08:00
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
|
|
|
|
<Setter Property="FontSize" Value="14" />
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="Padding" Value="20,5" />
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
|
|
|
<Border
|
|
|
|
|
Background="{TemplateBinding Background}"
|
2025-08-20 12:10:13 +08:00
|
|
|
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}"
|
2025-07-31 20:12:24 +08:00
|
|
|
SnapsToDevicePixels="True"
|
|
|
|
|
x:Name="border">
|
|
|
|
|
<ContentPresenter
|
|
|
|
|
Focusable="False"
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
Margin="{TemplateBinding Padding}"
|
|
|
|
|
RecognizesAccessKey="True"
|
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
x:Name="contentPresenter" />
|
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<!--<Trigger Property="IsDefaulted" Value="True" />-->
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
<Setter Property="Effect" TargetName="border">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<sve:BrightnessContrastEffect Brightness="0.1" />
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsPressed" Value="True">
|
|
|
|
|
<Setter Property="Effect" TargetName="border">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<sve:BrightnessContrastEffect Brightness="0.05" />
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
2025-08-12 23:08:54 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
2025-07-31 20:12:24 +08:00
|
|
|
<!--<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{Binding Path=(sva:ShadingElement.DisabledForeground), RelativeSource={RelativeSource TemplatedParent}}" />-->
|
2025-08-12 23:08:54 +08:00
|
|
|
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextDisabledBrush}" />
|
2025-07-31 20:12:24 +08:00
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</ResourceDictionary>
|