ToolBarControlBase.Items Property
Provides access to the collection of bar items displayed in the current ToolBarControlBase.
Namespace: DevExpress.Xpf.Bars
Assembly: DevExpress.Xpf.Core.v24.2.dll
NuGet Package: DevExpress.Wpf.Core
#Declaration
public ObservableCollection<IBarItem> Items { get; }
#Property Value
Type | Description |
---|---|
Observable |
A Observable |
#Remarks
Add BarItem and/or BarItemLinkBase descendants to the Items collection to display corresponding items in the current ToolBarControlBase control. In XAML, you can define items directly between the start and end tags of the ToolBarControlBase control descendants.
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
<dxb:MainMenuControl x:Name="mainMenu" Caption="MainMenu">
<dxb:BarSubItem Content="File">
<dxb:BarItemLink BarItemName="bNew"/>
<dxb:BarItemLink BarItemName="bOpen"/>
<dxb:BarItemLink BarItemName="bSave"/>
<dxb:BarItemLink BarItemName="bSaveAs"/>
<dxb:BarItemSeparator/>
<dxb:BarItemLink BarItemName="bPrint"/>
<dxb:BarItemSeparator/>
<dxb:BarButtonItem Content="Close" Glyph="{dx:DXImage Image=Close_16x16.png}"/>
</dxb:BarSubItem>
</dxb:MainMenuControl>
<dxb:ToolBarControl x:Name="fileToolBar" Caption="File" AllowCustomizationMenu="True" ShowBackground="False" Background="Red">
<dxb:BarButtonItem Name="bNew" Content="New" Glyph="{dx:DXImage Image=New_16x16.png}" LargeGlyph="{dx:DXImage Image=New_32x32.png}"/>
<dxb:BarButtonItem Name="bOpen" Content="Open" Glyph="{dx:DXImage Image=Open_16x16.png}" LargeGlyph="{dx:DXImage Image=Open_32x32.png}"/>
<dxb:BarButtonItem Name="bSave" Content="Save" Glyph="{dx:DXImage Image=Save_16x16.png}" LargeGlyph="{dx:DXImage Image=Save_32x32.png}"/>
<dxb:BarButtonItem Name="bSaveAs" Content="Save As" Glyph="{dx:DXImage Image=SaveAs_16x16.png}" LargeGlyph="{dx:DXImage Image=SaveAs_32x32.png}"/>
<dxb:BarItemLinkSeparator/>
<dxb:BarButtonItem Name="bPrint" Content="Print" Glyph="{dx:DXImage Image=Print_16x16.png}" LargeGlyph="{dx:DXImage Image=Print_32x32.png}" Alignment="Far"/>
</dxb:ToolBarControl>
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Items property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.