Bar

BarSplitButtonItem Class

Represents a bar button item supporting the drop-down functionality.

Namespace: DevExpress.Xpf.Bars

Assembly: DevExpress.Xpf.Core.v20.1.dll

Declaration

public class BarSplitButtonItem :
    BarButtonItem
Public Class BarSplitButtonItem
    Inherits BarButtonItem

Remarks

The BarSplitButtonItem supports the drop-down functionality, displaying a drop-down window when clicking the item link. The BarSplitButtonItem contains the main button, displaying the item's content and glyph, and a Down Arrow button. Clicking the main button invokes the ItemClick events (BarItem.ItemClick and BarManager.ItemClick) and a command (BarItem.Command). Clicking the Down Arrow button invokes the drop-down control, specified by the BarSplitButtonItem.PopupControl property.

BarSplitButtonItem

You can hide the Down Arrow button via the BarSplitButtonItem.ActAsDropDown property. In this instance, clicking the main button invokes the ItemClick events and the specified command. And in addition, the assigned drop-down control pops up.

BarSplitButtonItem can be used to implement a sub-menu in a RadialContextMenu.

Examples

This example shows how to create a BarSplitButtonItem, which represents a button with the drop-down functionality. Clicking the button's Down Arrow displays a popup window. To add a custom content into the popup, use the PopupControlContainer as the PopupControl. To add other bar items, use the PopupMenu.

The following image shows the result:

E1567

private void btnFontColor_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) {
    PopupControlContainer pcc = (e.Item as DevExpress.Xpf.Bars.BarSplitButtonItem).PopupControl as PopupControlContainer;
    Color color = ((pcc.Content as UserControl).Content as ColorChooser).Color;
    MessageBox.Show("Color is applied: " + color.ToString());
}

Implements

See Also