Fluent Design Frame navigation broken ForegroundColors Textblock and GroupBox
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
### Description
I'm using .Net 9 with Fluent Design. I've noticed that TextBlock and GroupBox display black text in dark mode when loaded in a frame.
I load the pages into the frame via a NavigationService. The pages themselves have horizontal tab items. When the page is loaded with tab items, the text of the TextBlock and GroupBox is black. When I switch between tabs, the text turns white.
Switch between Tabs
My workaround is to reassign the theme in the app via the Frame.ContentRendered event.
```C#
_frame.ContentRendered += (s, e) =>
{
#pragma warning disable WPF0001 // Der Typ dient nur zu Testzwecken und kann in zukünftigen Aktualisierungen geändert oder entfernt werden. Unterdrücken Sie diese Diagnose, um fortzufahren.
App.Current.ThemeMode = App.Current.ThemeMode;
#pragma warning restore WPF0001 // Der Typ dient nur zu Testzwecken und kann in zukünftigen Aktualisierungen geändert oder entfernt werden. Unterdrücken Sie diese Diagnose, um fortzufahren.
};
```
### Reproduction Steps
Use a Window. Use a Grid Columns 2.
Left place Buttons, right use a Frame. Generate Pages with TabControls. Each TabControls has further Frames.
Eg.
```XML
```
Insert Content to PageSearchBaugruppen
```XML
```
Load the first page via code behind `frame.NavigateTo`
### Expected behavior
### Actual behavior
### Regression?
_No response_
### Known Workarounds
My workaround is to reassign the theme in the app via the Frame.ContentRendered event.
```C#
_frame.ContentRendered += (s, e) =>
{
#pragma warning disable WPF0001 // Der Typ dient nur zu Testzwecken und kann in zukünftigen Aktualisierungen geändert oder entfernt werden. Unterdrücken Sie diese Diagnose, um fortzufahren.
App.Current.ThemeMode = App.Current.ThemeMode;
#pragma warning restore WPF0001 // Der Typ dient nur zu Testzwecken und kann in zukünftigen Aktualisierungen geändert oder entfernt werden. Unterdrücken Sie diese Diagnose, um fortzufahren.
};
```
### Impact
_No response_
### Configuration
.Net 9
Windows 11 different versions: e.g. 26100.4946
x64
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.