Setter using DynamicResource is not reapplied when related trigger condition is updated #13585
Labels
area-xaml
XAML, CSS, Triggers, Behaviors
fixed-in-8.0.0-rc.1.9171
Look for this fix in 8.0.0-rc.1.9171
platform/android 🤖
platform/iOS 🍎
platform/macOS 🍏
macOS / Mac Catalyst
platform/windows 🪟
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Milestone
Description
Assume the following style which is applied to a Button element:
When the button's IsEnabled property is changed to True after initially being False (for example upon a button click), the BackgroundColor property is not updated as expected. The issue is not present when using StaticResource instead.
Steps to Reproduce
Expected: Both Stop buttons have a Green background color.
Actual: Only the top Stop button (using StaticResource) has a Green background. The Button using the DynamicResource keeps its Purple color.
Link to public reproduction project repository
https://github.com/dilyantraykov/DynamicResourceIssueIsolation
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows, macOS
Affected platform versions
Android 33, Windows SDK 10.0.19041.0, iOS, MacCatalyst
Did you find any workaround?
One workaround is to use a StaticResource instead of a DynamicResource.
Another way around this is to explicitly define separate triggers for all the possible values for the styled property which may not be sustainable in most cases.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: