2025-07-31 20:12:01 +08:00
|
|
|
<ResourceDictionary
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2026-01-02 17:30:30 +08:00
|
|
|
xmlns:cvt="clr-namespace:VariaStudio.Converters"
|
|
|
|
|
xmlns:decorations="clr-namespace:VariaStudio.Controls.Decorations"
|
|
|
|
|
xmlns:internal="clr-namespace:VariaStudio.Converters.Internal"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
2025-07-31 20:12:24 +08:00
|
|
|
|
2025-09-06 00:36:23 +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>
|
2025-09-06 00:36:23 +08:00
|
|
|
<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-01-02 17:30:30 +08:00
|
|
|
Background="{TemplateBinding DarkShadowBrush}"
|
|
|
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
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-01-02 17:30:30 +08:00
|
|
|
x:Name="DarkBorder" />
|
2025-07-31 20:12:01 +08:00
|
|
|
<!-- 亮部 -->
|
|
|
|
|
<Border
|
2025-12-23 21:35:54 +08:00
|
|
|
Background="{TemplateBinding LightShadowBrush}"
|
2026-01-02 17:30:30 +08:00
|
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
|
|
|
Margin="{TemplateBinding Intensity,
|
|
|
|
|
Converter={x:Static internal:IntensityToEmbossMarginLeftTopConverter.Instance}}" />
|
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
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2026-01-02 17:30:30 +08:00
|
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
|
|
|
Margin="4"
|
|
|
|
|
Padding="{TemplateBinding Padding}">
|
2025-07-31 20:12:01 +08:00
|
|
|
<ContentPresenter
|
2025-12-23 21:35:54 +08:00
|
|
|
Focusable="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
2025-07-31 20:12:01 +08:00
|
|
|
RecognizesAccessKey="True"
|
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
2026-01-02 17:30:30 +08:00
|
|
|
TextElement.Foreground="{TemplateBinding Foreground}"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
x:Name="contentPresenter" />
|
2025-07-11 09:20:23 +08:00
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</ResourceDictionary>
|