Skip to content

Commit d33231f

Browse files
authored
Fix FontSize reference (lepoco#1413)
1 parent eab1f1a commit d33231f

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/Wpf.Ui/Controls/IconElement/FontIcon.cs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,13 @@ public string Glyph
110110

111111
protected TextBlock? TextBlock { get; set; }
112112

113-
protected override UIElement InitializeChildren()
113+
public FontIcon()
114114
{
115-
if (FontSize.Equals(SystemFonts.MessageFontSize))
116-
{
117-
SetResourceReference(FontSizeProperty, "DefaultIconFontSize");
118-
119-
// If the FontSize is the default, set it to the parent's FontSize.
120-
if (
121-
VisualParent is not null
122-
&& TextElement.GetFontSize(VisualParent) != SystemFonts.MessageFontSize
123-
)
124-
{
125-
SetCurrentValue(FontSizeProperty, TextElement.GetFontSize(VisualParent));
126-
}
127-
}
115+
SetCurrentValue(FontSizeProperty, UiApplication.Current.Resources["DefaultIconFontSize"]);
116+
}
128117

118+
protected override UIElement InitializeChildren()
119+
{
129120
TextBlock = new TextBlock
130121
{
131122
Style = null,

0 commit comments

Comments
 (0)