-
Notifications
You must be signed in to change notification settings - Fork 739
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
fix: ThemeResource
bindings are not scope-updated on Style
switch
#13016
Conversation
this should be a backport candidate for 4x |
@Xiaoy312 yes, backport will follow up after it is merged 👍 |
formatting issue @MartinZikmund |
The build 87407 found UI Test snapshots differences: Details
|
@Mergifyio backport legacy/4x |
✅ Backports have been created
|
fix: `ThemeResource` bindings are not scope-updated on `Style` switch (backport #13016)
GitHub Issue (If applicable): closes #12496
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Previously only
StaticResource
bindings were re-evaluated whenStyle
was applied. This is not enough asThemeResources
also need to be sourced from the current scope. In addition, the precedence override needs to be applied only while the setters are being applied, but not for the resource bindings update, otherwise it could also apply base control bindings withExplicitStyle
precedence, even though the bindings have justImplicitStyle
precedence.What is the new behavior?
Fixed!
Copilot Summary
🤖 Generated by Copilot at e51e120
This pull request fixes a bug and adds a test for theme resource resolution in styles. It refactors the
Style.ApplyTo
method to make it more clear and consistent. It also creates a new user control with two styles for a button, one using a theme resource and one using a static resource, and a new test method that asserts that the button's background color changes correctly when the style is switched at runtime.PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.