Files
Shrlalgo.RvKits/NeuWPF/NeoUI/Controls/Hyperlink.xaml
2025-08-20 12:10:13 +08:00

35 lines
2.1 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:assists="clr-namespace:NeumUI.Assists"
xmlns:controls="clr-namespace:NeumUI.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type controls:Hyperlink}">
<Setter Property="Background" Value="{x:Null}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryNormalBrush}" />
<Setter Property="assists:ControlAssist.MouseOverForeground" Value="{DynamicResource PrimaryFocusedBrush}" />
<Setter Property="assists:ControlAssist.PressedForeground" Value="{DynamicResource PrimaryNormalBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Hyperlink}">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="Content" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="TextElement.Foreground" TargetName="Content" Value="{Binding Path=(assists:ControlAssist.MouseOverForeground), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="TextElement.Foreground" TargetName="Content" Value="{Binding Path=(assists:ControlAssist.PressedForeground), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>