功能完善
This commit is contained in:
35
NeuWPF/NeoUI/Controls/Hyperlink.xaml
Normal file
35
NeuWPF/NeoUI/Controls/Hyperlink.xaml
Normal file
@@ -0,0 +1,35 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user