共用方式為


ContextMenuService.AddContextMenuOpeningHandler 方法

定義

加入 ContextMenuOpening 附加事件的處理常式。

public:
 static void AddContextMenuOpeningHandler(System::Windows::DependencyObject ^ element, System::Windows::Controls::ContextMenuEventHandler ^ handler);
public static void AddContextMenuOpeningHandler (System.Windows.DependencyObject element, System.Windows.Controls.ContextMenuEventHandler handler);
static member AddContextMenuOpeningHandler : System.Windows.DependencyObject * System.Windows.Controls.ContextMenuEventHandler -> unit
Public Shared Sub AddContextMenuOpeningHandler (element As DependencyObject, handler As ContextMenuEventHandler)

參數

element
DependencyObject

接聽這個事件的 UIElementContentElement

handler
ContextMenuEventHandler

要加入的事件處理常式。

適用於