Files
Shrlalgo.RvKits/Melskin/Controls/Decorations/LightedSurface.xaml

63 lines
3.4 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"
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations">
2025-07-31 20:12:01 +08:00
<Style TargetType="{x:Type decorations:LightedSurface}">
2025-07-11 09:20:23 +08:00
<Setter Property="Focusable" Value="False" />
<Setter Property="LightColorBrush" Value="#FF111319" />
2025-08-24 13:49:55 +08:00
<Setter Property="LightSize" Value="200" />
2025-07-11 09:20:23 +08:00
<Setter Property="Padding" Value="5" />
<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="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type decorations:LightedSurface}">
2025-07-11 09:20:23 +08:00
<ControlTemplate.Resources>
<Storyboard x:Key="ShowLight">
2025-07-31 20:12:01 +08:00
<DoubleAnimation
Storyboard.TargetProperty="LightIntensity"
2026-02-20 15:31:44 +08:00
To="1"
Duration="0:0:0.2" />
2025-07-11 09:20:23 +08:00
</Storyboard>
<Storyboard x:Key="HideLight">
2025-07-31 20:12:01 +08:00
<DoubleAnimation
Storyboard.TargetProperty="LightIntensity"
2026-02-20 15:31:44 +08:00
To="0"
Duration="0:0:0.2" />
2025-07-11 09:20:23 +08:00
</Storyboard>
</ControlTemplate.Resources>
2025-07-31 20:12:01 +08:00
<Border
2026-02-20 15:31:44 +08:00
x:Name="PART_lightBorder"
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}">
<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"
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>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource ShowLight}" />
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource HideLight}" />
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>