Skip to content

Commit 3971241

Browse files
authored
Introduce base style for Hyperlink (MaterialDesignInXAML#4000)
Users can select this style when they want font size and font weight to align with parent elements in the visual tree.
1 parent dab0f47 commit 3971241

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Hyperlink.xaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
33

44
<!-- updated specification 2018 -->
5-
<Style x:Key="MaterialDesignBody1Hyperlink" TargetType="{x:Type Hyperlink}">
6-
<Setter Property="FontSize" Value="16" />
7-
<Setter Property="FontWeight" Value="Regular" />
5+
<Style x:Key="MaterialDesignHyperlink" TargetType="{x:Type Hyperlink}">
86
<Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />
97
<Setter Property="TextDecorations" Value="None" />
108
<Style.Triggers>
@@ -24,6 +22,13 @@
2422
</Style.Triggers>
2523
</Style>
2624

25+
<Style x:Key="MaterialDesignBody1Hyperlink"
26+
TargetType="{x:Type Hyperlink}"
27+
BasedOn="{StaticResource MaterialDesignHyperlink}">
28+
<Setter Property="FontSize" Value="16" />
29+
<Setter Property="FontWeight" Value="Regular" />
30+
</Style>
31+
2732
<Style x:Key="MaterialDesignBody2Hyperlink"
2833
TargetType="{x:Type Hyperlink}"
2934
BasedOn="{StaticResource MaterialDesignBody1Hyperlink}">

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TextBlock.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
</ResourceDictionary.MergedDictionaries>
66

77
<Style x:Key="MaterialDesignTextBlock" TargetType="{x:Type TextBlock}">
8+
<Style.Resources>
9+
<Style TargetType="Hyperlink" BasedOn="{StaticResource MaterialDesignHyperlink}" />
10+
</Style.Resources>
811
<Setter Property="FontSize" Value="13" />
912
<Setter Property="FontWeight" Value="Regular" />
1013
<Setter Property="Padding" Value="0,4" />

0 commit comments

Comments
 (0)