[RC1/9.0] Backport Dark Mode fix #11924
Merged
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.
Backport the Dark Mode Fix into .NET 9RC1.
The original bug fix (#11907) addressed a series of issues (#11910, #11898, #11897, #11895).
Since the original bug fix used Properties-APIs, which are not available in .NET 9RC/Rel, a few adjustments had to be made here. To further ensure stability, I added basic unit tests for dark mode.
Customer Impact
We introduced a new experimental Feature “Dark Mode”. This accidentally regressed VB Apps, which are no longer able to enable Visual Styles. This PR would also address a couple of minor issues in Dark Mode itself, which have been found in recent testing.
Workaround: For the VB Part, there is no easy workaround, since
Application.EnableVisualStyles
is usually run in Program.cs, and in a VB App Framework App, there is no equivalent.The issues of the new features do not have a workaround, but they also did not exist before.
Regression?
Risk
Verification
Microsoft Reviewers: Open in CodeFlow