Files
Shrlalgo.RvKits/Melskin/Controls/Card.xaml
2026-02-12 21:29:00 +08:00

57 lines
3.2 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:Melskin.Controls"
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type controls:Card}">
<Setter Property="Focusable" Value="False" />
<Setter Property="Padding" Value="10,8" />
<Setter Property="CornerRadius" Value="4" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderGradientBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Card}">
<Border x:Name="mainBorder">
<decorations:LightedSurface
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Foreground="{TemplateBinding Foreground}"
HorizontalContentAlignment="Stretch"
LightSize="{TemplateBinding LightSize}"
Margin="4"
Padding="0"
VerticalContentAlignment="Stretch">
<ContentPresenter
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
TextElement.Foreground="{TemplateBinding Foreground}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="contentPresenter" />
</decorations:LightedSurface>
<Border.Effect>
<DropShadowEffect
BlurRadius="12"
Color="{DynamicResource DarkShadowColor}"
Opacity="0.6" />
</Border.Effect>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="ShaderEnabled" Value="False">
<Setter Property="Effect" TargetName="mainBorder" Value="{x:Null}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>