Files
ShrlAlgoToolkit/AntDesignWPF/Controls/Hyperlink/Hyperlink.xaml

40 lines
2.6 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-07-31 20:12:24 +08:00
xmlns:controls="clr-namespace:AntDesignWPF.Controls"
xmlns:helpers="clr-namespace:AntDesignWPF.Helpers"
2025-07-31 20:12:01 +08:00
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
2025-07-31 20:12:24 +08:00
<ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Themes/Converters.xaml" />
<ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Controls/Control.xaml" />
2025-07-31 20:12:01 +08:00
</ResourceDictionary.MergedDictionaries>
<Style BasedOn="{StaticResource Ant.TextElement}" TargetType="{x:Type controls:Hyperlink}">
<Setter Property="Background" Value="{x:Null}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
2025-07-31 20:12:24 +08:00
<Setter Property="Foreground" Value="{DynamicResource AntDesign.Brush.Link}" />
<Setter Property="helpers:AntControl.MouseOverForeground" Value="{Binding Foreground, Mode=OneWay, ConverterParameter=5, RelativeSource={RelativeSource Self}, Converter={StaticResource ColorPaletteConverter}}" />
<Setter Property="helpers:AntControl.PressedForeground" Value="{Binding Foreground, Mode=OneWay, ConverterParameter=7, RelativeSource={RelativeSource Self}, Converter={StaticResource ColorPaletteConverter}}" />
2025-07-31 20:12:01 +08:00
<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">
2025-07-31 20:12:24 +08:00
<Setter Property="TextElement.Foreground" TargetName="Content" Value="{Binding Path=(helpers:AntControl.MouseOverForeground), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
2025-07-31 20:12:01 +08:00
</Trigger>
<Trigger Property="IsPressed" Value="True">
2025-07-31 20:12:24 +08:00
<Setter Property="TextElement.Foreground" TargetName="Content" Value="{Binding Path=(helpers:AntControl.PressedForeground), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
2025-07-31 20:12:01 +08:00
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>