From 90d4e241ea03d8f4828f5da37bc07762e87146ba Mon Sep 17 00:00:00 2001 From: Nice3point Date: Sun, 13 Apr 2025 18:19:08 +0300 Subject: [PATCH] Fix FontSize reference --- src/Wpf.Ui/Controls/IconElement/FontIcon.cs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/Wpf.Ui/Controls/IconElement/FontIcon.cs b/src/Wpf.Ui/Controls/IconElement/FontIcon.cs index 6bc9a6168..e24acdc38 100644 --- a/src/Wpf.Ui/Controls/IconElement/FontIcon.cs +++ b/src/Wpf.Ui/Controls/IconElement/FontIcon.cs @@ -110,22 +110,13 @@ public string Glyph protected TextBlock? TextBlock { get; set; } - protected override UIElement InitializeChildren() + public FontIcon() { - if (FontSize.Equals(SystemFonts.MessageFontSize)) - { - SetResourceReference(FontSizeProperty, "DefaultIconFontSize"); - - // If the FontSize is the default, set it to the parent's FontSize. - if ( - VisualParent is not null - && TextElement.GetFontSize(VisualParent) != SystemFonts.MessageFontSize - ) - { - SetCurrentValue(FontSizeProperty, TextElement.GetFontSize(VisualParent)); - } - } + SetCurrentValue(FontSizeProperty, UiApplication.Current.Resources["DefaultIconFontSize"]); + } + protected override UIElement InitializeChildren() + { TextBlock = new TextBlock { Style = null,