fix template

This commit is contained in:
qile.wang 2024-03-06 19:21:48 +08:00
parent 8dee3ec364
commit 801fea8269

View File

@ -13,64 +13,14 @@
<Setter Property="MinHeight" Value="32" />
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForeground}" />
<Setter Property="Background" Value="{DynamicResource HyperlinkButtonDefaultBackground}" />
<Setter Property="Template">
<ControlTemplate TargetType="HyperlinkButton">
<ContentPresenter
Background="{TemplateBinding Background}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Cursor="{TemplateBinding Cursor}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
Padding="{TemplateBinding Padding}"
RecognizesAccessKey="True"
TextElement.FontFeatures="{TemplateBinding FontWeight}"
TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}"
UseLayoutRounding="False"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="PART_ContentPresenter" />
</ControlTemplate>
</Setter>
<!-- Unvisited Pointerover State -->
<Style Selector="^:pointerover">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonOverForeground}" />
</Style>
<!-- Unvisited Pressed State -->
<Style Selector="^:pressed">
<Setter Property="RenderTransform" Value="scale(0.98)" />
</Style>
<!-- Unvisited Disabled state -->
<Style Selector="^:disabled">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonDisabledForeground}" />
</Style>
<Style Selector="^:visited">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonVisitedForeground}" />
<!-- Visited Pointerover State -->
<Style Selector="^:pointerover">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonOverForeground}" />
</Style>
<!-- Visited Pressed State -->
<Style Selector="^:pressed">
<Setter Property="RenderTransform" Value="scale(0.98)" />
</Style>
<!-- Visited Disabled State -->
<Style Selector="^:disabled">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonDisabledForeground}" />
</Style>
</Style>
<Style Selector="^.WithIcon">
<Setter Property="Template">
<ControlTemplate TargetType="HyperlinkButton">
<Grid ColumnDefinitions="Auto,*" x:Name="RootGrid">
<Grid Grid.Column="0" VerticalAlignment="Center">
<Grid
Grid.Column="0"
IsVisible="False"
VerticalAlignment="Center"
x:Name="IconGrid">
<Border
Background="{DynamicResource HyperlinkButtonDefaultBackground}"
Height="{DynamicResource HyperlinkButtonIconHeight}"
@ -99,7 +49,7 @@
</Grid>
</ControlTemplate>
</Setter>
<!-- Unvisited Pointerover State -->
<Style Selector="^:pointerover">
<Style Selector="^ /template/ PathIcon#LinkGlyph">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonOverForeground}" />
@ -157,6 +107,11 @@
</Style>
</Style>
</Style>
<Style Selector="^.WithIcon">
<Style Selector="^ /template/ Grid#IconGrid">
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>