You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying out the new fluent ui theming in .NET 9 but hit an issue where the theme styles aren't inherited by pages. (update: Seems to only be for TextBlocks?)
Reproduction Steps
Create new WPF project with .NET 9
Set ThemeMode="Dark" in App.xaml
Create a Page with just a TextBlock
In MainWindow.xaml, add a Frame and navigate to the created Page
Expected behavior
Page's textblock is styled appropriately (light foreground color since background is dark)
Actual behavior
Text foreground is dark
Regression?
No response
Known Workarounds
No response
Impact
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered:
safreed-msft
changed the title
ThemeMode style not applying to pages
ThemeMode style not applying to TextBlock in a Page
Apr 11, 2025
Hey @safreed-msft, yes this is a known issue with Page, one simple workaround for this is to add the Foreground="{DynamicResource TextFillColorPrimaryBrush}" as an attribute of Page tag.
@safreed-msft, this is more of a limitation of implicit styles. Implicit styles are not loaded for derived types. We did some workarounds for Window and put it in WPF for now. But this was difficult to do for Page, hence we left it this way. The real solution will be that we load the Fluent styles in default style and we are working on that now.
Given this, if you are okay, can I go ahead and close this issue.
Description
I'm trying out the new fluent ui theming in .NET 9 but hit an issue where the theme styles aren't inherited by pages. (update: Seems to only be for TextBlocks?)
Reproduction Steps
Expected behavior
Page's textblock is styled appropriately (light foreground color since background is dark)
Actual behavior
Text foreground is dark
Regression?
No response
Known Workarounds
No response
Impact
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: