我是从ContextMenu派生的,在派生类中我需要手动引发ContextMenuClosing事件。我尝试了以下两种方式:
// On runtime tells me it can't convert from
// "System.Windows.RoutedEventArgs" to
// "System.Windows.Controls.ContextMenuEventArgs"
RaiseEvent(new RoutedEventArgs(ContextMenuClosingEvent));
// Second attempt: On compile time tells me,
// there's no constructor for ContextMenuEventArgs
OnContextMenuClosing(new ContextMenuEventArgs());
我是RoutedEvents的新手,有人可以帮我解决如何手动提升ContextMenuClosing事件的问题吗?谢谢!