1
我從ContextMenu派生並派生類內部我需要手動提高ContextMenuClosing事件。我嘗試以下兩種方式:手動提高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事件?謝謝!