WPF if sizechanged event does not bubble, does it tunnel?

WPF如果sizechanged事件没有泡沫,隧道吗?

Tags: c# wpf xaml layout
标签: c# wpf xaml layout

问题 (Question)

I noted that according to: http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.sizechanged%28v=vs.95%29.aspx

the sizechanged event does not bubble upwards to parent elements. Does it tunnel downward then? I'm just curious how sizechanged works exactly. After a size on an element changes, does the event propagate in some direction until it is handled? if it doesn't propagate then how is it a routed event.

我指出,根据:http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.sizechanged%28v=vs.95%29.aspx

sizechanged事件没有泡沫的向上的父元素。隧道向下然后呢?我只是好奇sizechanged是如何工作的。对一个元素的大小改变后,事件传播一些方向,直到它处理吗?如果它不传播如何路由事件。

最佳答案 (Best Answer)

There is actually 3rd routing strategy. Direct events which neither bubble nor tunnel and are raised only by one control and FrameworkElement.SizeChanged is exactly one of these events.

实际上是第三路由策略。泡沫和隧道的直接事件,只有一个控制和提高FrameworkElement.SizeChanged正是这些事件之一。

本文翻译自StackoverFlow,英语好的童鞋可直接参考原文:http://stackoverflow.com/questions/16925942