Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/Wpf.Ui/Controls/IconElement/FontIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ public string Glyph

protected override UIElement InitializeChildren()
{
if (VisualParent is not null)
{
SetCurrentValue(FontSizeProperty, TextElement.GetFontSize(VisualParent));
}

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));
}
}

TextBlock = new TextBlock
Expand Down