Files
ShrlAlgoToolkit/NeoUI/Melskin/Controls/Hyperlink.xaml

56 lines
3.9 KiB
Plaintext
Raw Normal View History

2025-08-12 23:08:54 +08:00
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2026-01-02 17:30:30 +08:00
xmlns:assists="clr-namespace:VariaStudio.Assists"
xmlns:controls="clr-namespace:VariaStudio.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2025-08-12 23:08:54 +08:00
<Style TargetType="{x:Type controls:Hyperlink}">
<Setter Property="Background" Value="{x:Null}" />
2025-10-10 11:19:58 +08:00
<Setter Property="Cursor" Value="Hand" />
2025-12-23 21:35:54 +08:00
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
2025-08-12 23:08:54 +08:00
<Setter Property="VerticalContentAlignment" Value="Center" />
2025-10-10 11:19:58 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextLinkBrush}" />
2025-12-23 21:35:54 +08:00
<Setter Property="assists:ColorAssist.MouseOverForeground" Value="{DynamicResource PrimaryHoverBrush}" />
<Setter Property="assists:ColorAssist.FocusedForeground" Value="{DynamicResource PrimaryFocusedBrush}" />
2025-08-12 23:08:54 +08:00
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Hyperlink}">
<Grid Background="{TemplateBinding Background}">
2025-12-23 21:35:54 +08:00
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<controls:IconElement
2026-01-02 17:30:30 +08:00
Foreground="{DynamicResource TextLinkBrush}"
2025-08-12 23:08:54 +08:00
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
2026-01-02 17:30:30 +08:00
Symbol="Link"
2025-08-12 23:08:54 +08:00
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
2026-01-02 17:30:30 +08:00
x:Name="Icon" />
2025-12-23 21:35:54 +08:00
<ContentPresenter
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
2026-01-02 17:30:30 +08:00
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="Content" />
2025-08-12 23:08:54 +08:00
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
2026-01-02 17:30:30 +08:00
<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}}" />
2025-08-12 23:08:54 +08:00
</Trigger>
<Trigger Property="IsPressed" Value="True">
2026-01-02 17:30:30 +08:00
<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}}" />
2025-12-23 21:35:54 +08:00
</Trigger>
<Trigger Property="IsVisited" Value="True">
2026-01-02 17:30:30 +08:00
<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}}" />
2025-08-12 23:08:54 +08:00
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>