UI.WPF.Modern icon indicating copy to clipboard operation
UI.WPF.Modern copied to clipboard

[Enchantment] font icons theming theme aware bug fix

Open GID0317 opened this issue 3 months ago • 1 comments

The stricter condition caused scenarios (like in the https://github.com/iNKORE-NET/UI.WPF.Modern/pull/343#issuecomment-3247861427) where an icon visually sat beside text that updated its brush, but the icon didn’t because the Parent/VisualParent relationship didn’t meet the extra inequality test. Removing Parent != VisualParent lets normal visual-parent brush changes flow more consistently.

After this change the Icons more reliably pick up ancestor Foreground (especially dynamic theme resources) when their own Foreground wasn’t explicitly set. Explicit Foreground still opt‑out automatically. No public API change.

The impact of change so far was very low. But it can be investigated more if it breaks something

GID0317 avatar Sep 16 '25 10:09 GID0317

Thanks for the review. Yes, inheritance is preserved. If FontIcon.Foreground is unset, the glyph inherits/updates from its visual parent. if set, it uses that value. The only change is we no longer forcibly copy VisualParentForeground in rare edge cases where the control itself wouldn’t inherit.

GID0317 avatar Oct 05 '25 06:10 GID0317