FrameworkElement.ContextMenu 属性

定义

获取或设置上下文菜单元素,此元素应在每次通过用户界面请求上下文菜单时显示, (UI) 此元素中。Gets or sets the context menu element that should appear whenever the context menu is requested through 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

属性值

ContextMenu

分配给此元素的上下文菜单。The context menu assigned to this element.

注解

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
元数据属性设置为 trueMetadata properties set to true None

适用于

另请参阅