Files
Shrlalgo.RvKits/NeoUI/Melskin/Controls/Hyperlink.xaml
2026-01-02 17:30:41 +08:00

56 lines
3.9 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:assists="clr-namespace:Melskin.Assists"
xmlns:controls="clr-namespace:Melskin.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type controls:Hyperlink}">
<Setter Property="Background" Value="{x:Null}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Foreground" Value="{DynamicResource TextLinkBrush}" />
<Setter Property="assists:ColorAssist.MouseOverForeground" Value="{DynamicResource PrimaryHoverBrush}" />
<Setter Property="assists:ColorAssist.FocusedForeground" Value="{DynamicResource PrimaryFocusedBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Hyperlink}">
<Grid Background="{TemplateBinding Background}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<controls:IconElement
Foreground="{DynamicResource TextLinkBrush}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Symbol="Link"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="Icon" />
<ContentPresenter
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="Content" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" TargetName="Icon" Value="{Binding Path=(assists:ColorAssist.MouseOverForeground), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="TextElement.Foreground" TargetName="Content" Value="{Binding Path=(assists:ColorAssist.MouseOverForeground), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Foreground" TargetName="Icon" Value="{Binding Path=(assists:ColorAssist.FocusedForeground), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="TextElement.Foreground" TargetName="Content" Value="{Binding Path=(assists:ColorAssist.FocusedForeground), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="IsVisited" Value="True">
<Setter Property="Foreground" TargetName="Icon" Value="{Binding Path=(assists:ColorAssist.FocusedForeground), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="TextElement.Foreground" TargetName="Content" Value="{Binding Path=(assists:ColorAssist.FocusedForeground), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>