2010-07-05 78 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即使其構造函數是私人的