Skip to main content

Items and Links

  • 2 minutes to read

Overview

Bar items and bar item links are objects that represent the contents of Bars, Ribbon and Menus. The following image demonstrates a toolbar that contains various bar items.

Toolbar

Bar items are BarItem class descendants. They can represent buttons, editors, static text, ribbon galleries and item containers.

Bar item links represent bar items that are defined in another location.

The following example demonstrates a Paste BarButtonItem defined in a toolbar. The Edit menu contains a BarButtonItemLink object that references the toolbar button.

BarItemLinks Common

<DockPanel>
    <dxb:MainMenuControl Caption="Main Menu" DockPanel.Dock="Top">
            <!-- Represents the "Edit" menu -->
            <dxb:BarSubItem Name="bsEdit" Content="Edit">
                <!-- BarButtonItemLink references the "bPaste" bar item -->
                <dxb:BarButtonItemLink BarItemName="bPaste"/>
                <!-- ... -->
            </dxb:BarSubItem>
        </dxb:MainMenuControl>

        <!-- Represents the toolbar -->
        <dxb:ToolBarControl DockPanel.Dock="Top">
            <!-- Represents the "Paste" button within the toolbar. -->
            <dxb:BarButtonItem Name="bPaste" Content="Paste" Glyph="{dx:DXImage Image=Paste_16x16.png}" 
                               KeyGesture="Ctrl+V" />
            <!-- ... -->
        </dxb:ToolBarControl>
        <!-- ... -->
</DockPanel>

Note

For the complete description of all bar items, see The List of Bar Items and Links

Further Reading

To learn more about bar items and bar item links, see the following topics.

See Also