[release/9.0] Fixes window backdrop and background in Windows 10 and window theme interactions with system changes #10136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes # #10096
Description
In Windows 10, when using Fluent theme the background of the window appears black. This PR fixes the issue by including a DataTrigger that checks the OS version and in case of Windows 10, it sets the background accordingly as Windows 10 doesn't support the backdrop operations through DWM.
Secondly, when Application is Light / Dark ( not System ) the Window's with ThemeMode set to system didn't react to system theme changes. This was because, when application is in light or dark, the state of fluent theme state for application didn't change and we returned it from the function without checking the window's thememode. We enabled that behavior in this PR.
Customer Impact
Developers can use Fluent theme in Windows 10 without using the backdrop switch. Enables the correct behavior for Window System theme mode when Application's theme mode is set to Light and Dark.
Regression
Yes. This worked in .NET 9 Preview 4
Testing
Sample app testing + Unit tests
Risk
Minimal. Fixes the behavior of Fluent theme in Windows 10 and when application theme is set to Light / Dark
Microsoft Reviewers: Open in CodeFlow