Monday, November 22, 2010

Getting Attached property inheritance to propagate

Programmer Question

I am having trouble getting an attached property value to propagate down the tree from a parent to a child in the visual hierarchy. The setup is as follows:



I have a custom panel that instantiates a Viewport3D. The Panel then handles the child added and removed to create and add an inherited Visual3D class for each child item.



I am trying to declare an attached property called AttachedToggle property. I would like to have this property reside in an external owner class called AttachedToggle which implements the single attached dependency property IsChecked and allow either the parent Panel or any of the children Visual3D elements to be able to change the value and have the other elements' instance values reflect the change. Neither the Panel nor the Visual3D class inherit from a common base. Can this be done?



I can successfully change both the parent and child instance value of IsChecked from application code using Set/GetValue but am unable to get the change to propagate.



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails