Files
ShrlAlgoToolkit/NeoUI/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-01-02 17:30:30 +08:00
xmlns:decorations="clr-namespace:VariaStudio.Controls.Decorations"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
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
2026-01-02 17:30:30 +08:00
Duration="0:0:0.2"
2025-07-31 20:12:01 +08:00
Storyboard.TargetProperty="LightIntensity"
2026-01-02 17:30:30 +08:00
To="1" />
2025-07-11 09:20:23 +08:00
</Storyboard>
<Storyboard x:Key="HideLight">
2025-07-31 20:12:01 +08:00
<DoubleAnimation
2026-01-02 17:30:30 +08:00
Duration="0:0:0.2"
2025-07-31 20:12:01 +08:00
Storyboard.TargetProperty="LightIntensity"
2026-01-02 17:30:30 +08:00
To="0" />
2025-07-11 09:20:23 +08:00
</Storyboard>
</ControlTemplate.Resources>
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}"
x:Name="PART_lightBorder">
<ContentPresenter
Focusable="False"
2026-01-02 17:30:30 +08:00
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
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>
<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>