-
Notifications
You must be signed in to change notification settings - Fork 802
test: Validate root element requested theme behavior #21184
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where RequestedTheme
set on a root control before loading was not properly applied to the application-level theme. The fix ensures theme synchronization occurs both during the loading phase and when theme changes are made.
Key changes:
- Refactored theme synchronization logic into a reusable method
- Added theme sync during the loading phase to handle pre-load theme settings
- Enhanced test coverage with validation for the fixed behavior
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Uno.UI/UI/Xaml/FrameworkElement.cs | Refactored theme sync logic and added sync during loading phase |
src/Uno.UI/UI/Xaml/Application.cs | Added new method to sync theme from XamlRoot with null validation |
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_Window.cs | Added test to validate theme behavior when set before loading |
src/Uno.UI.RuntimeTests/Helpers/ThemeHelper.cs | Added CurrentTheme property for test utilities |
Comments suppressed due to low confidence (1)
src/Uno.UI.RuntimeTests/Helpers/ThemeHelper.cs:30
- The new CurrentTheme property is not being used in any tests within this PR. Consider adding a test that validates this property works correctly or remove it if it's intended for future use.
public static ElementTheme CurrentTheme
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21184/docs/index.html |
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21184/wasm-skia-net9/index.html |
|
018f216
to
981606f
Compare
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21184/wasm-skia-net9/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21184/docs/index.html |
|
GitHub Issue: closes https://github.com/unoplatform/kahua-private/issues/307
PR Type: 🐞 Bugfix
What is the current behavior? 🤔
When
RequestedTheme
is set on root control before it is loaded, it is not properly applied to the application-level theme.What is the new behavior? 🚀
Applied
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.