FrameworkElement.ContextMenu Property

Definition

取得或設定透過操作功能表項目的 使用者介面 (UI)user interface (UI) 要求操作功能表時應該出現的操作功能表項目。Gets or sets the context menu element that should appear whenever the context menu is requested through 使用者介面 (UI)user interface (UI) from within this element.

public:
 property System::Windows::Controls::ContextMenu ^ ContextMenu { System::Windows::Controls::ContextMenu ^ get(); void set(System::Windows::Controls::ContextMenu ^ value); };
public System.Windows.Controls.ContextMenu ContextMenu { get; set; }
member this.ContextMenu : System.Windows.Controls.ContextMenu with get, set
Public Property ContextMenu As ContextMenu

Property Value

ContextMenu

指派給這個項目的操作功能表。The context menu assigned to this element.

Remarks

ContextMenu 本身是 FrameworkElement 的衍生類別,而且在技術上可能會讓 ContextMenu 本身具有 ContextMenu 屬性。ContextMenu itself is a FrameworkElement derived class, and it is technically possible for ContextMenu itself to have a ContextMenu property. 不過,這會為使用者建立令人困惑的內容功能表體驗,因此不建議使用這種作法。However, this creates a confusing context menu experience for the user and this practice is not recommended.

相依性屬性資訊Dependency Property Information

識別碼欄位Identifier field ContextMenuProperty
設定為 true 的中繼資料屬性Metadata properties set to true NoneNone

Applies to

See also