microsoft-ui-xaml: TreeView does not respect SystemAccentColor override
Describe the bug
The TreeView will only respect the OS system colour. As a developer, if I override the SystemAccentColor in my App.xaml file, the entire app should respect my new override. However, the TreeView does not respect it.
Steps to reproduce the bug
Steps to reproduce the behavior:
- Clone this repo and check out the
themeBugbranch: https://github.com/dpaulino/treeviewtest/tree/themeBug - Change your OS system colour to anything except for
#00CC6A(light green). - Launch the app from Visual Studio 2019 by pressing F5.
- Click on any tree item.
- You will find the tree item will be highlighted with the OS system colour, while one of the buttons in the sample app will be using the override colour as listed in
App.xaml.
Expected behavior
The tree should respect the SystemAccentColor override.
Screenshots

Version Info
NuGet package version: 2.1.190606001
| Windows 10 version | Saw the problem? |
|---|---|
| Insider Build (xxxxx) | |
| May 2019 Update (18362) | yes |
| October 2018 Update (17763) | |
| April 2018 Update (17134) | |
| Fall Creators Update (16299) | |
| Creators Update (15063) |
| Device form factor | Saw the problem? |
|---|---|
| Desktop | Yes |
| Mobile | |
| Xbox | |
| Surface Hub | |
| IoT |
Additional context
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 19 (18 by maintainers)
@dpaulino As a workaround for now, you could use the accent brushes used by the ListView:
The issue you are seeing here is that the brushes used for the TreeViewItem are not picking up the overriden
SystemAccentColor. The ListViewItem brushes do, however, because they are directly consuming the overridenSystemAccentColor:SystemAccentColorLight3is not updated (or its update is not propagated down to the app) whenSystemAccentColoris overriden. See for example the following XAML (with<Color x:Key="SystemAccentColor">#00CC6A</Color>overriden on the app level):with the result:
This particular bug for the
SystemControlHighlightAccent3RevealBackgroundBrushcan only be fixed with WinUI 3. In the meantime, you can use the brushes used by the ListView as a workaround. For the TreeView specifically, WInUI could change the default brushes to the brushes used by the ListView, though there probably was a reason why those weren’t chosen in the first place.Friendly ping. Any thoughts on whether this will be addressed or not?