Bar

BarSplitButtonItem.PopupControl Property

Gets or sets a drop-down control for the BarSplitButtonItem.

Namespace: DevExpress.Xpf.Bars

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

Declaration

public IPopupControl PopupControl { get; set; }

Property Value

Type Description
DevExpress.Xpf.Bars.IPopupControl

An IPopupControl object that represents a control displayed in the drop-down window.

Remarks

You can set the PopupControl property to any of these objects:

Example

This example creates a BarSplitButtonItem (a button with drop-down). Click the button’s Down Arrow to display a popup window. To add a custom popup content, use the PopupControlContainer as the PopupControl. To add other bar items, use the PopupMenu.

In XAML

<dxb:BarContainerControl>
    <dxb:ToolBarControl UseWholeRow="True">
        <dxb:BarSplitButtonItem Name="btnFontColor" Content="FontColor" Glyph="{dx:DXImage Image=ChangeFontStyle_16x16.png}" ArrowAlignment="Bottom" ItemClick="btnFontColor_ItemClick">
            <dxb:BarSplitButtonItem.PopupControl>
                <dxb:PopupControlContainer>
                    <UserControl>
                        <dxe:ColorChooser/>
                    </UserControl>
                </dxb:PopupControlContainer>
            </dxb:BarSplitButtonItem.PopupControl>
        </dxb:BarSplitButtonItem>
    </dxb:ToolBarControl>
</dxb:BarContainerControl>

In Code-Behind

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());
}

E1567

View Example

See Also