-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataGrid Header colours are not adapting to Dark Theme. (Are they not using ThemeResources?) #2373
Comments
This seems to be another issue when the theme is changed in runtime. Seems to work when the app is launched in dark theme. @WilliamABradley, any thoughts on this? |
ThemeResources update at runtime if the Theme changes, but StaticResources do not. So if you are using the ControlTemplate's ResourceDictionary, make sure you are calling on and using ThemeResources. See if that helps |
@mdtauk is right, I do see a lot of resources specified as StaticResources which might be the source of the problem. @MSRegisB - can you take a look? |
Although progress has been made in fixing this, I noticed that the DataGrid still fails to utilize the color defined with:
|
The following does not work either to change the background. The foreground changes but the background does not.
|
Also, when changing theme from Dark to System(on my system it's Light), all text rows are totally white, instead of changing into black, making them invisible. |
At this point, there is no bug when toggling the RequestedTheme in the Sample app from
Regarding ApplicationPageBackgroundThemeBrush, I think it's #FF1D1D1D in Dark theme and #FFF4F4F4 in Light theme. Using this should work:
|
@RBrid I'm very happy to confirm that your method finally works! I'm now able to style the DataGrid headers to match my app's custom dark theme. |
Customer unblocked. |
I'm submitting a...
Bug report (I searched for similar issues and did not find one)
Current behavior
The Header row does not change colours to adapt to the Dark Theme. Either System Wide Dark Theme, or when toggling the RequestedTheme in the Sample App
Hover state also does not display correctly
Expected behavior
The Header row should use an appropriate dark background with light foreground, whilst still offering differentiation with the rows below
Appropriate Hover states should be used as well.
Minimal reproduction of the problem with instructions
Environment
The text was updated successfully, but these errors were encountered: