且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从.NET C#中的用户控件引发父窗口上的事件

更新时间:2023-10-11 10:34:10

您需要一个RoutedEvent 链接

You need a RoutedEvent link

"路由事件是在可视树中向上或向下导航的事件 根据他们的RoutingStrategy.路由策略可以是泡沫, 隧道或直接.您可以将事件处理程序连接到 通过使用引发事件或在事件之上或之下的其他元素上 附加的事件语法:Button.Click ="Button_Click".

"Routed events are events which navigate up or down the visual tree acording to their RoutingStrategy. The routing strategy can be bubble, tunnel or direct. You can hook up event handlers on the element that raises the event or also on other elements above or below it by using the attached event syntax: Button.Click="Button_Click"."