Raising an event on parent window from a user control in .NET C#

后端 未结 2 2064
天涯浪人
天涯浪人 2021-02-04 02:13

The title pretty much explains the question. I have a user control loaded into the main window when the application is first run. What I want to do is to raise an event on paren

2条回答
  •  春和景丽
    2021-02-04 02:40

    You need a RoutedEvent link

    "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"."

提交回复
热议问题