Event Handler
我使用以下代码订阅/创建自定义:
myButton.Click += (sender, e) => MyButtonClick(sender, e, stuff1, stuff2);
我想取消订阅/删除并尝试这样:
myButton.Click += MyButtonClick;
但抛出以下错误:
No overload for 'MyButtonClick' matches delegate 'System.Windows.RoutedEventHandler'
像这样:
myButton.Click += MyButtonClick(sender, e, stuff1, stuff2);
但抛出以下错误:
Cannot implicitly convert type 'void' to 'System.Windows.RoutedEventHandler'
我如何取消订阅/删除相同的Event Handler
?