Files
ShrlAlgoToolkit/NeuWPF/NeoUI/Controls/Card.xaml

57 lines
3.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"
2025-08-20 12:10:13 +08:00
xmlns:controls="clr-namespace:NeumUI.Controls"
xmlns:svd="clr-namespace:NeumUI.Controls.Decorations"
2025-07-31 20:12:01 +08:00
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2025-07-31 20:12:24 +08:00
<Style TargetType="{x:Type controls:Card}">
2025-07-11 09:20:23 +08:00
<Setter Property="Focusable" Value="False" />
<Setter Property="CornerRadius" Value="4" />
2025-08-12 23:08:54 +08:00
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
<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-07-31 20:12:01 +08:00
<svd: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" />
2025-07-11 09:20:23 +08:00
</svd:LightedSurface>
<Border.Effect>
2025-07-31 20:12:01 +08:00
<DropShadowEffect
BlurRadius="12"
2025-08-12 23:08:54 +08:00
Color="{DynamicResource DarkShadowColor}"
2025-07-31 20:12:01 +08:00
Opacity="0.6" />
2025-07-11 09:20:23 +08:00
</Border.Effect>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="ShaderEnabled" Value="False">
2025-07-31 20:12:01 +08:00
<Setter Property="Effect" TargetName="mainBorder" Value="{x:Null}" />
2025-07-11 09:20:23 +08:00
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>