I want to hook my control's visual parent's events.
+1
A:
You can override the OnVisualParentChanged()
method to be notified when ever your visual parent changes.
Note that it is almost always a bad idea to actually use this: In 99% of cases the data template should take care of hooking up related controls by setting their properties, or it is better handled with attached inherited properties. But for the other 1% there is OnVisualParentChanged()
.
Ray Burns
2010-02-13 00:10:50