Files

70 lines
4.2 KiB
Plaintext
Raw Permalink Normal View History

2025-07-31 20:12:01 +08:00
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2026-02-20 15:31:44 +08:00
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2026-01-02 17:30:41 +08:00
xmlns:cvt="clr-namespace:Melskin.Converters"
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations"
2026-02-20 15:31:44 +08:00
xmlns:internal="clr-namespace:Melskin.Converters.Internal">
2025-07-31 20:12:24 +08:00
<Style TargetType="{x:Type decorations:EmbossBorder}">
2025-07-11 09:20:23 +08:00
<Setter Property="Focusable" Value="False" />
<Setter Property="CornerRadius" Value="4" />
2025-09-04 22:39:00 +08:00
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
2025-08-26 21:33:20 +08:00
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
2025-08-12 23:08:54 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
2025-07-11 09:20:23 +08:00
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
2025-08-20 12:10:13 +08:00
<Setter Property="Padding" Value="4" />
2025-07-11 09:20:23 +08:00
<Setter Property="FontSize" Value="14" />
<Setter Property="Intensity" Value="1" />
2025-08-12 23:08:54 +08:00
<Setter Property="LightShadowBrush" Value="{DynamicResource LightShadowBrush}" />
<Setter Property="DarkShadowBrush" Value="{DynamicResource DarkShadowBrush}" />
2025-07-11 09:20:23 +08:00
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type decorations:EmbossBorder}">
2025-07-11 09:20:23 +08:00
<Grid>
2025-07-31 20:12:01 +08:00
<!-- 光影区域 -->
2025-08-20 12:10:13 +08:00
<!-- 默认4的边距显示光影效果 -->
2025-07-31 20:12:24 +08:00
<Grid Margin="4" Visibility="{TemplateBinding ShaderEnabled, Converter={x:Static cvt:BooleanToVisibilityConverter.CollapsedInstance}}">
2025-07-31 20:12:01 +08:00
<!-- 暗部 -->
<Border
2026-02-20 15:31:44 +08:00
x:Name="DarkBorder"
2025-07-31 20:12:01 +08:00
Margin="{TemplateBinding Intensity,
2025-08-12 23:08:54 +08:00
Converter={x:Static internal:IntensityToEmbossMarginRightBottomConverter.Instance}}"
2026-02-20 15:31:44 +08:00
Background="{TemplateBinding DarkShadowBrush}"
CornerRadius="{TemplateBinding CornerRadius}" />
2025-07-31 20:12:01 +08:00
<!-- 亮部 -->
<Border
2026-01-02 17:30:30 +08:00
Margin="{TemplateBinding Intensity,
2026-02-20 15:31:44 +08:00
Converter={x:Static internal:IntensityToEmbossMarginLeftTopConverter.Instance}}"
Background="{TemplateBinding LightShadowBrush}"
CornerRadius="{TemplateBinding CornerRadius}" />
2025-07-31 20:12:01 +08:00
<!-- 模糊效果 -->
2025-07-11 09:20:23 +08:00
<Grid.Effect>
2025-07-31 20:12:24 +08:00
<BlurEffect Radius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Intensity, Converter={x:Static internal:IntensityToEmbossBlurConverter.Instance}, Mode=OneWay}" />
2025-07-11 09:20:23 +08:00
</Grid.Effect>
</Grid>
2025-07-31 20:12:01 +08:00
<!-- 内容区域 -->
2025-08-20 12:10:13 +08:00
<!-- 默认4的边距显示光影效果 -->
2025-07-31 20:12:01 +08:00
<Border
2026-02-20 15:31:44 +08:00
Margin="4"
Padding="{TemplateBinding Padding}"
2025-07-31 20:12:01 +08:00
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
2026-02-20 15:31:44 +08:00
CornerRadius="{TemplateBinding CornerRadius}">
2025-07-31 20:12:01 +08:00
<ContentPresenter
2026-02-20 15:31:44 +08:00
x:Name="contentPresenter"
2026-01-02 17:30:30 +08:00
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
2026-02-20 15:31:44 +08:00
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
2025-07-31 20:12:01 +08:00
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
2026-02-20 15:31:44 +08:00
TextElement.Foreground="{TemplateBinding Foreground}" />
2025-07-11 09:20:23 +08:00
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>