From wpf-dev-pack
Resolves text font inheritance issues in WPF CustomControls using Segoe Fluent Icons, where TextBlocks in ControlTemplates render text as symbols or boxes. Explicitly sets FontFamily on text elements like Segoe UI.
npx claudepluginhub christian289/dotnet-with-claudecode --plugin wpf-dev-packThis skill uses the workspace's default tool permissions.
When using Segoe Fluent Icons font in WPF CustomControl, **TextBlocks within the same ControlTemplate inherit the icon font, causing text to render incorrectly**.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
When using Segoe Fluent Icons font in WPF CustomControl, TextBlocks within the same ControlTemplate inherit the icon font, causing text to render incorrectly.
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.
<!-- IconButton ControlTemplate Example -->
<ControlTemplate TargetType="{x:Type local:IconButton}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<StackPanel Orientation="{TemplateBinding Orientation}"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<!-- Icon: Use Segoe Fluent Icons -->
<TextBlock x:Name="PART_Icon"
Text="{TemplateBinding Icon}"
FontFamily="Segoe Fluent Icons, Segoe MDL2 Assets"
FontSize="{TemplateBinding IconSize}"
Foreground="{TemplateBinding Foreground}" />
<!-- Text: Explicitly specify Segoe UI (Important!) -->
<TextBlock x:Name="PART_Text"
Text="{TemplateBinding Text}"
FontFamily="Segoe UI"
FontSize="12"
Foreground="{TemplateBinding Foreground}"
VerticalAlignment="Center" />
</StackPanel>
</Border>
</ControlTemplate>
Segoe Fluent Icons only on PART_IconFontFamily="Segoe UI" is required on PART_Text| Font Name | Windows Version | Purpose |
|---|---|---|
Segoe Fluent Icons | Windows 11+ | Latest Fluent Design icons |
Segoe MDL2 Assets | Windows 10+ | Default system icons |
FontFamily="Segoe Fluent Icons, Segoe MDL2 Assets"
Specify fallback font for Windows 10 compatibility