Files
ShrlAlgoToolkit/NeuWPF/NeoUI/Controls/Decorations/LightedSurface.xaml

62 lines
3.3 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: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-11 09:20:23 +08:00
<Style TargetType="{x:Type svd:LightedSurface}">
<Setter Property="Focusable" Value="False" />
<Setter Property="LightColorBrush" Value="#FF111319" />
<Setter Property="LightSize" Value="300" />
<Setter Property="Padding" Value="5" />
2025-08-12 23:08:54 +08:00
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
<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 svd:LightedSurface}">
<ControlTemplate.Resources>
<Storyboard x:Key="ShowLight">
2025-07-31 20:12:01 +08:00
<DoubleAnimation
Duration="0:0:0.2"
Storyboard.TargetProperty="LightIntensity"
To="1" />
2025-07-11 09:20:23 +08:00
</Storyboard>
<Storyboard x:Key="HideLight">
2025-07-31 20:12:01 +08:00
<DoubleAnimation
Duration="0:0:0.2"
Storyboard.TargetProperty="LightIntensity"
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}"
CornerRadius="{TemplateBinding CornerRadius}"
x:Name="PART_lightBorder">
2025-08-12 23:08:54 +08:00
<Border BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding CornerRadius}">
2025-07-31 20:12:01 +08:00
<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
</Border>
</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>