Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想挂钩我的控件的可视父事件。
您可以覆盖在OnVisualParentChanged()视觉父级更改时通知的方法。
OnVisualParentChanged()
请注意,实际使用它几乎总是一个坏主意:在 99% 的情况下,数据模板应该通过设置属性来处理关联控件,或者使用附加的继承属性更好地处理。但对于另外 1% 来说,有OnVisualParentChanged().