How to achieve DP inheritance value in silverlight?

How to achieve inheritance of DP values ​​in silverlight, or is there any way to share the value of a parent property with children, Datacontext cannot be used in my case.

+4
source share
2 answers

You will have to write code to handle this yourself.

Some existing API types, such as the UIElementFrameworkElementControl hierarchy, implement some form of “value inheritance”, for example FontFamily , etc. However, the code inside these types handles this; there is no general mechanism to support the concept.

+1
source

I did it a little differently, I tried to set the Binding for the property for the parent property in the constructor. Therefore, after creating the object, if you set an explicit value, the binding will be removed. Otherwise, it is bound to the Parent x property.

+1
source

All Articles