resolving-icon-font-inheritance

Installation
SKILL.md

WPF CustomControl Icon Font Inheritance Issue Resolution

Problem Scenario

When using Segoe Fluent Icons font in WPF CustomControl, TextBlocks within the same ControlTemplate inherit the icon font, causing text to render incorrectly.

Symptoms

  • Button text displays as square boxes (□) or strange symbols
  • Icons display correctly but regular text doesn't render

Cause

WPF's FontFamily is inherited to child elements following the Visual Tree. When FontFamily="Segoe Fluent Icons" is set on a TextBlock for icons within a ControlTemplate, other TextBlocks in the same container may inherit this font.


Solution

Explicitly Specify FontFamily on Text-Displaying Elements

Related skills

More from christian289/dotnet-with-claudecode

Installs
3
GitHub Stars
31
First Seen
Feb 28, 2026