且构网

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

如何从主窗体中捕获用户控件中特定按钮上的点击事件

更新时间:2023-12-06 12:15:40

该行:

this.AddHandler(UIElement.TappedEvent, new TappedEventHandler(Page02_CloseButtonTapped), true);

将MainPage的轻击事件与Page02_CloseButtonTapped方法相关联.因此,任何点击事件都会触发该方法.

is associating the tapped event of the MainPage to Page02_CloseButtonTapped method. So any tap event on it will fire the method.

我假设您打算将其附加到Page02控件的CloseButtonTapped事件上?

I'm assuming you meant to attach it to the CloseButtonTapped event on the Page02 control instead?