Skip to content
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

Dynamic resource value is not applied for the property #25978

Open
Abinaya-SF4661 opened this issue Nov 20, 2024 · 1 comment
Open

Dynamic resource value is not applied for the property #25978

Abinaya-SF4661 opened this issue Nov 20, 2024 · 1 comment
Labels
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

Comments

@Abinaya-SF4661
Copy link

Abinaya-SF4661 commented Nov 20, 2024

Description

I created a CustomContentView class which inherits ContentView and created a LabelStyle class which inherits Element.
In CustomContentView class, I set its content as Label and created a bindable property for LabelStyle.
In LabelStyle class, I created a bindable property called BackgroundColor and created a SetBackgroundColor method which is used to apply the color by checking the IsSet method.

I set the Color in ResourceDictionary with key. Using the key, I set the BackgroundColor property as Dynamic resource inside LabelStyle property. By setting this way, the color from ResourceDictionary is not applied to the property. Initially, when the control is called the value of dynamic resource is applied to the property. So, while checking the IsSet method, it should return true. If IsSet is true, then the default color is not applied to the property. But in this case, IsSet is return false, so the default color is re applied to the BackgroundColor property.

But, when setting the LabelStyle in the Resource dictionary and apply this style to LabelStyle property as Dynamic resource in CustomContentView, the value is applied to the LabelStyle.

Steps to Reproduce

Run the attached application

Expected Outcome - given color in Dynamic resource is applied to the property
Actual Outcome - the default color of property applied

Sample.zip

Link to public reproduction project repository

No response

Version with bug

9.0.10 SR1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows, Android, macOS, iOS

Affected platform versions

No response

Did you find any workaround?

when setting the LabelStyle in the Resource dictionary and apply this style to LabelStyle property as Dynamic resource in CustomContentView, the value is applied to the LabelStyle.

Refer the below image to reproduce this case in the above sample
Image

Relevant log output

Nil

@Abinaya-SF4661 Abinaya-SF4661 added the t/bug Something isn't working label Nov 20, 2024
@ninachen03 ninachen03 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Nov 21, 2024
@ninachen03
Copy link

This issue has been verified using Visual Studio 17.13.0 Preview 1.0 (9.0.10& 9.0.0 &9.0.0-preview.7.24407.4 &8.0.100 &8.0.3). Can repro it.
Image

@PureWeen PureWeen added this to the Backlog milestone Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Projects
None yet
Development

No branches or pull requests

4 participants