wpf-devexpress-dot-xpf-dot-bars-feae0662.md
A container for bar items that can have only one selected item.
Namespace : DevExpress.Xpf.Bars
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
public class BarItemSelector :
BarLinkContainerItem
Public Class BarItemSelector
Inherits BarLinkContainerItem
You can use the BarItemSelector to group BarCheckItems. Once a user checks an item, the selector unchecks the previously selected item.
<dxb:ToolBarControl>
<dxb:BarItemSelector>
<dxb:BarCheckItem Glyph="{dx:DXImage 'SvgImages/Icon Builder/Actions_Question.svg'}"/>
<dxb:BarCheckItem Glyph="{dx:DXImage 'SvgImages/Icon Builder/Security_Warning.svg'}"/>
<dxb:BarCheckItem Glyph="{dx:DXImage 'SvgImages/Icon Builder/Security_WarningCircled1.svg'}"/>
</dxb:BarItemSelector>
</dxb:ToolBarControl>
The BarItemSelector does not allow users to uncheck items. Set the AllowEmptySelection property to true to change this behavior.
The BarItemSelector can obtain its items from the View Model collection:
Create a collection of items that should be displayed in the BarItemSelector:
Bind the ItemLinksSource property to the created collection.
Specify a template that generates items and assign it to the ItemTemplate property.
The SelectedItem property allows you to define a checked item in the View Model.
<dxb:BarSubItem Content="Priority">
<dxb:BarItemSelector ItemLinksSource="{Binding Priorities}"
SelectedItem="{Binding SelectedPriority}">
<dxb:BarItemSelector.ItemTemplate>
<DataTemplate>
<ContentControl>
<dxb:BarCheckItem Content="{Binding Name}"/>
</ContentControl>
</DataTemplate>
</dxb:BarItemSelector.ItemTemplate>
</dxb:BarItemSelector>
</dxb:BarSubItem>
Object DispatcherObject DependencyObject ContentElement FrameworkContentElement BarItem BarLinkContainerItem BarItemSelector
See Also