In This Article

ContextMenu Class

Represents a ContextMenu that is capable of displaying ribbon control menu items.

public class ContextMenu : ContextMenu
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl MenuBase ContextMenu object

Remarks

For detailed documentation on this control's features and how to use them, please see the ContextMenu documentation topic.

Constructors

ContextMenu()

Initializes a new instance of the ContextMenu class.

public ContextMenu()

Properties

AdditionalContent

Gets the additional content to display above or below the context menu.

public object AdditionalContent { get; }

Property Value

object:

The additional content to display above or below the context menu.

IsAdditionalContentBelow

Gets whether the additional content is above or below the context menu.

public bool IsAdditionalContentBelow { get; }

Property Value

bool:

true if the additional content is below the context menu; otherwise, false.

MiniToolBar

Gets or sets the MiniToolBar to display when this context menu is displayed.

public MiniToolBar MiniToolBar { get; set; }

Property Value

MiniToolBar:

The MiniToolBar to display when this context menu is displayed.

Methods

IsItemItsOwnContainerOverride(object)

Determines if the specified item is (or is eligible to be) its own item container.

protected override bool IsItemItsOwnContainerOverride(object item)
Parameter Type Description
item object

Specified item.

Returns

bool:

true if the item is its own item container; otherwise, false.

OnKeyDown(KeyEventArgs)

Occurs when a key is pressed while the control has focus.

protected override void OnKeyDown(KeyEventArgs e)
Parameter Type Description
e KeyEventArgs

A KeyEventArgs that contains the event data.

OnOpened(RoutedEventArgs)

Occurs when the context menu is opened.

protected override void OnOpened(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

A RoutedEventArgs that contains the event data.

Fields

AdditionalContentProperty

Identifies the AdditionalContent dependency property. This field is read-only.

public static readonly DependencyProperty AdditionalContentProperty

IsAdditionalContentBelowProperty

Identifies the IsAdditionalContentBelow dependency property. This field is read-only.

public static readonly DependencyProperty IsAdditionalContentBelowProperty

MiniToolBarProperty

Identifies the MiniToolBar dependency property. This field is read-only.

public static readonly DependencyProperty MiniToolBarProperty