开发者

Access SurfaceWindow from TagVisualization

I'm looking for an easy way to access my main Su开发者_StackOverflow中文版rfaceWindow from a TagVisualization that I have. The scenario is that I want to pass along data from my TagVisualization back to the SurfaceWindow. Is there an easy way to do this?

Thanks


TagVisualization inherits from FrameworkElement, so a Parent property is available. You can climb the hierarchy that way until you get to the SurfaceWindow.

HTH


Generally, I'd recommend you to think about your overall architecture of your application, since you're introducing a tighter coupling between your controls that is normally desirable.

That said, you can walk your apps visual tree using the VisualTreeHelper

This stack overflow question has a lot of details about finding controls, and especially the answer containing the FindVisualParent helper method

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜