NavBarGroup.Items Property

Gets the collection of items within the group and provides indexed access to them.

Namespace: DevExpress.Xpf.NavBar

Assembly: DevExpress.Xpf.NavBar.v21.2.dll


public NavBarItemCollection Items { get; }

Property Value

Type Description

A NavBarItemCollection object representing the collection of the group’s items.


If a group’s NavBarGroup.DisplaySource property is set to DisplaySource.Items, the content of the group’s client region is defined using the Items property. This property provides access to a collection that contains all the items of the current group. This collection provides a standard means to manipulate (add or remove) items within a group. A particular item can be accessed using index notation.


The NavBarGroup.Items property is, by design, specified as the default property and the content property of a group. This, for example, allows you to declare items in XAML directly after a group declaration, without wrapping them into opening and closing NavBarGroup.Items tags.

See the Group Content Model topic to learn more.


This example demonstrates how items can be created and customized programmatically within a navbar group.

In this sample, images are defined for the group header and the third group item via the NavBarGroup.ImageSource and NavBarItem.ImageSource properties, respectively. The item image’s layout is customized by assigning the item’s NavBarItem.VisualStyle property with a specific style that makes use of the NavBarViewBase.LayoutSettings attached property’s LayoutSettings.ImageDocking setting.

View Example

private void CreateGroup1(NavBarControl navBar){
    NavBarGroup group1 = new NavBarGroup();
    group1.Header = "Items";
    //Display an image within the group's header
    group1.ImageSource = new BitmapImage(new Uri("pack://application:,,,/Images/folder.png"));

    NavBarItem item1 = new NavBarItem();
    item1.Content = "Home";

    NavBarItem item2 = new NavBarItem();
    item2.Content = "Work";

    NavBarItem item3 = new NavBarItem();
    item3.Content = "Private";
    //Display an image within the item
    item3.ImageSource = new BitmapImage(new Uri("pack://application:,,,/Images/private.png"));
    //Change item image layout
    Style itemStyle = new Style();
    itemStyle.Setters.Add(new Setter(NavBarViewBase.LayoutSettingsProperty, new LayoutSettings() { ImageDocking = Dock.Right }));
    item3.VisualStyle = itemStyle;

See Also