Files
Shrlalgo.RvKits/Melskin/Controls/Card.xaml

92 lines
5.1 KiB
Plaintext
Raw 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:controls="clr-namespace:Melskin.Controls"
2026-02-20 15:31:44 +08:00
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations">
2026-02-22 20:03:42 +08:00
<Style x:Key="FloatLightedCardStyle" TargetType="{x:Type controls:Card}">
2025-07-11 09:20:23 +08:00
<Setter Property="Focusable" Value="False" />
2025-08-26 21:33:20 +08:00
<Setter Property="Padding" Value="10,8" />
2025-07-11 09:20:23 +08:00
<Setter Property="CornerRadius" Value="4" />
2025-08-26 21:33:20 +08:00
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
2025-08-12 23:08:54 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderGradientBrush}" />
2025-07-11 09:20:23 +08:00
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
2025-07-31 20:12:24 +08:00
<ControlTemplate TargetType="{x:Type controls:Card}">
2025-07-11 09:20:23 +08:00
<Border x:Name="mainBorder">
2025-09-04 22:39:00 +08:00
<decorations:LightedSurface
2026-02-20 15:31:44 +08:00
Margin="4"
Padding="0"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
2025-07-31 20:12:01 +08:00
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Foreground="{TemplateBinding Foreground}"
2026-02-20 15:31:44 +08:00
LightSize="{TemplateBinding LightSize}">
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
Margin="{TemplateBinding Padding}"
2026-02-20 15:31:44 +08:00
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
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-09-04 22:39:00 +08:00
</decorations:LightedSurface>
2025-07-11 09:20:23 +08:00
<Border.Effect>
2025-07-31 20:12:01 +08:00
<DropShadowEffect
BlurRadius="12"
2026-02-20 15:31:44 +08:00
Opacity="0.6"
Color="{DynamicResource DarkShadowColor}" />
2025-07-11 09:20:23 +08:00
</Border.Effect>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="ShaderEnabled" Value="False">
2026-02-20 15:31:44 +08:00
<Setter TargetName="mainBorder" Property="Effect" Value="{x:Null}" />
2025-07-11 09:20:23 +08:00
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
2026-02-22 20:03:42 +08:00
<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 BackgroundContainerBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Card}">
<Border
x:Name="mainBorder"
Padding="0"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<ContentPresenter
x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
TextElement.Foreground="{TemplateBinding Foreground}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
2025-07-11 09:20:23 +08:00
</ResourceDictionary>