Skip to main content


  • 4 minutes to read

You can provide your applications with various context menus of different appearances and functionality. This document demonstrates how to implement and customize these menus.

There are three available types of context menus/popup controls.

You can display a menu in one of the following approaches:

  • Use the BarManager.DXContextMenu attached property to associate your menu with the desired UI object. The menu is automatically displayed when an end-user right-clicks the related control. To manually invoke a menu associated with the targeted UI element, call the static BarPopupBase.ShowElementContextMenu method.
  • Call the BarPopupBase.ShowPopup method to show the menu relative to the specified UI element. Use this approach in case you do not want to explicitly associate your UI objects with specific menus.

Popup menu and popup control containers can also serve as drop-down controls for BarSplitButtonItem objects.

WPF - Menus - Popup Menu

The popup menu is an instance of the PopupMenu class. This menu displays bar items and links from the PopupMenu.Items collection.

Items within the popup menu are arranged in a single column. You can use the following techniques to split them in multiple columns:

To visually separate neighboring items, add a BarItemSeparator between them. Another option is to group your items into BarItemMenuHeader containers. These containers allow you to create groups with different captions and orientation.

Radial Menu

WPF - Menus - Radial Menu

Radial menu is a popup menu inspired by Microsoft Note 2013. These menus are represented by objects of the RadialContextMenu class.

Same as for regular popup menus, radial menus display bar items and links. To populate a radial menu in XAML mark-up, define required items and links between the menu’s opening and closing tags. To do the same in code, use the PopupMenu.Items and PopupMenu.ItemLinks collections.

By default, first radial menu item is displayed within the first sector. Sectors are indexed clockwise starting from zero at midnight. Use the RadialContextMenu.FirstSectorIndex property to specify which sector should display the first menu item. You can also leave one or multiple sectors empty. To do so, set the RadialContextMenu.MinSectorCount property to a number greater than the amount of items, displayed by this menu.

In the middle of a radial menu sits the button that expands or collapses this menu. When a menu is collapsed, this button is the only visual element that remains visible to end-users. By default, when end-users invoke a radial menu, it expands automatically. You can toggle the RadialContextMenu.AutoExpand property value in order to change this behavior.

To create a multi-level radial menu, add BarSplitButtonItem objects to the menu’s item collection. When end-users click these sub-menus at runtime, the radial menu replaces its initially visible items with child items, owned by the clicked button. At the same time, the central expand\collapse button becomes replaced by the back button. End-users can click this button to navigate back from sub-menus to their parent containers.

WPF - Menus - Popup Container

A container that can host other controls and supports the popup functionality. Represented by the PopupControlContainer class instance in code.

To specify a content for a popup control container, use the PopupControlContainer.Content property. In this example a popup control container hosts a color picker dialog and serves as a drop-down control for a BarSplitButtonItem object.


Visual Studio has a design-time issue that may cause an exception in an XAML file when you initialize a property with a PopupControlContainer object. If this is the case, initialize this property with the PopupControlContainerInfo object instead. The PopupControlContainerInfo creates a corresponding PopupControlContainer internally and has the same settings as the PopupControlContainer.

See Also