Changing the Foreground Brush of PathIcon does Nothing
See original GitHub issueDescribe the bug
Within Avalonia itself, changing the Foreground color of the ComboBox’s DropDownGlyph PathIcon in Fluent theme does nothing.
See: https://github.com/AvaloniaUI/Avalonia/pull/7837#discussion_r830514883
Strangely this does not work. I can change Data property here just fine but the Foreground property is ignored completely. I can set it to Red here and there will be no effect.
If the Foreground is set above in the PathIcon declaration it works fine. If Foreground is set within the template of PathIcon itself it works fine. I can’t imagine what priority-type issue is causing the issue here…
This is a big problem in my opinion and I’ve already seen that it affects SplitButton as well. I’m unsure where the issue is and will need someone from the core team to confirm. My guess is the priority of the properties isn’t being set correctly for Foreground somehow. I also could be missing something simple…
To Reproduce
- Go to ComboBox.xaml in the Fluent theme
- Modify the “Normal State” as below. The
Foregroundis now set toRed<Style Selector="ComboBox /template/ PathIcon#DropDownGlyph"> <Setter Property="Foreground" Value="Red" /> <Setter Property="Data" Value="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z" /> </Style> - Run ControlCatalog. The DropDownGlyph color does not change.
- Note that if you modify Data it will be updated just fine.
Expected behavior
The color should change.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Windows
- Version: Latest master as of 22-Mar-2022
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (6 by maintainers)

Top Related StackOverflow Question
It’s actually a simple fix: In
FluentControls.xaml, move the<StyleInclude>for PathIcon to the top. The problem is PathIcon declared inComboBoxis being overwritten when the actualPathIconfile loads - there’s a comment in there aboutToolTiptoo. Personally I don’t like the templated icons thing for reasons I’m not gonna get into here, but that at least with the current styling system, template load order matters@alexanderdeman are you using stable version? This issue was related to nightly builds only. In the stable version you do it with different selector, check out default styles: https://github.com/AvaloniaUI/Avalonia/blob/stable/0.10.x/src/Avalonia.Themes.Fluent/Controls/ComboBox.xaml#L198-L200