更新
This commit is contained in:
48
AntdWpf/Styles/Hyperlink.xaml
Normal file
48
AntdWpf/Styles/Hyperlink.xaml
Normal file
@@ -0,0 +1,48 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:AntdWpf.Controls"
|
||||
xmlns:helpers="clr-namespace:AntdWpf.Helpers">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Styles/Converters.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Styles/Control.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style BasedOn="{StaticResource Ant.TextElement}" TargetType="{x:Type controls:Hyperlink}">
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource LinkBrush}" />
|
||||
<Setter Property="helpers:Control.MouseOverForeground"
|
||||
Value="{Binding Foreground, Mode=OneWay, ConverterParameter=5,
|
||||
RelativeSource={RelativeSource Self}, Converter={StaticResource ColorPaletteConverter}}" />
|
||||
<Setter Property="helpers:Control.PressedForeground"
|
||||
Value="{Binding Foreground, Mode=OneWay, ConverterParameter=7,
|
||||
RelativeSource={RelativeSource Self}, Converter={StaticResource ColorPaletteConverter}}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:Hyperlink}">
|
||||
<Grid Background="{TemplateBinding Background}">
|
||||
<ContentPresenter x:Name="Content"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Content"
|
||||
Property="TextElement.Foreground"
|
||||
Value="{Binding Path=(helpers:Control.MouseOverForeground), Mode=OneWay,
|
||||
RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="Content"
|
||||
Property="TextElement.Foreground"
|
||||
Value="{Binding Path=(helpers:Control.PressedForeground), Mode=OneWay,
|
||||
RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user