2010-07-05 61 views
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事件?谢谢!

回答

0

this question海报显示的代码,他似乎能够实例化ContextMenuEventArgs即使其构造函数是私人的