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
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
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
Relevant log output
Nil