The requested page is not available for the requested platform. You are viewing the content for Default platform.

ContextMenu Members

Represents a flyout menu that can be attached to any visual element.

Constructors

Name Description
ContextMenu()

Initializes a new instance of the ContextMenu class with the default settings.

ContextMenu(FrameworkElement)

Initializes a new instance of the ContextMenu class with the specified settings.

ContextMenu(FrameworkElement, Boolean)

Fields

Name Description
ContentProperty

Identifies the ContextMenu.Content dependency property.

FlyoutPlacementBehaviorProperty

Identifies the ContextMenu.FlyoutPlacementBehavior dependency property.

FlyoutSettingsProperty

Identifies the ContextMenu.FlyoutSettings dependency property.

HeaderProperty

Identifies the ContextMenu.Header dependency property.

MenuProperty

Identifies the ContextMenu.Menu dependency property.

RequestedThemeProperty

Identifies the ContextMenu.RequestedTheme dependency property.

Properties

Name Description
Content

Gets or sets the UI element that represents the context menu. This is a dependency property.

FlyoutSettings

Gets or sets the flyout settings applied to the menu. This is a dependency property.

Header

Gets or sets the menu header. This is a dependency property.

IsOpen

Gets whether the menu is currently opened.

RequestedTheme

Gets or sets the theme that should be used for the menu content specified by the ContextMenu.Content property.

Methods

Name Description
Close()

Closes the context menu.

GetFlyoutPlacementBehavior(FlyoutBase)

Gets the value of the ContextMenu.FlyoutPlacementBehavior attached property for a specified flyout element.

GetMenu(DependencyObject)

Gets the value of the ContextMenu.Menu attached property for a specified DependencyObject.

Open()

Opens the context menu.

Open(ContextMenuInfo)

Opens the context menu.

Open(Object, Object, UIElement, Point, String, FlyoutSettingsBase)

Opens the context menu.

Open(Point)

Opens the context menu.

SetFlyoutPlacementBehavior(FlyoutBase, FlyoutPlacementBehavior)

Sets the value of the ContextMenu.FlyoutPlacementBehavior attached property to a specified flyout element.

SetMenu(DependencyObject, ContextMenu)

Sets the value of the ContextMenu.Menu attached property to a specified DependencyObject.

Events

Name Description
Closed

Fires after the context menu has been closed.

Opened

Fires after the context menu has been opened.

Opening

Fires when the context menu is about to be invoked.

Attached Properties

Name Description
FlyoutPlacementBehavior

Gets or sets whether the menu is aligned relative to its target or the cursor. This is an attached property. This is a dependency property.

Menu

Gets or sets the Context Menu assigned to the visual element. This is an attached property. This is a dependency property.

See Also