FrameworkElement.ContextMenu FrameworkElement.ContextMenu FrameworkElement.ContextMenu FrameworkElement.ContextMenu Property

定义

获取或设置通过 用户界面 (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

属性值

分配给此元素的上下文菜单。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 NoneNone

适用于

另请参阅