Skip to main content

NavBarGroup.DisplaySource Property

Gets or sets a value that specifies which property (NavBarGroup.Items or NavBarGroup.Content) defines the group’s content. This is a dependency property.

Namespace: DevExpress.Xpf.NavBar

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

NuGet Package: DevExpress.Wpf.NavBar


public DisplaySource DisplaySource { get; set; }

Property Value

Type Description

One of the DisplaySource enumeration values.

Available values:

Name Description

Specifies that group content is represented by the NavBarGroup.Items property.


Specifies that group content is represented by the NavBarGroup.Content property.


Use the DisplaySource property to control whether the group’s content is represented by items from the NavBarGroup.Items collection or by a custom content defined via the NavBarGroup.Content property. By default, the NavBarGroup.Items property is used to represent group contents.

To learn more, see the Group Content Model topic.


This examples demonstrates how a group can be created programmatically, and its content can be defined using a StackPanel and two TextBlock controls. The second TextBlock displays the text of the selected item within the NavBarControl.

View Example

private void CreateGroup2(NavBarControl navBar){
    NavBarGroup group2 = new NavBarGroup();
    group2.Header = "Custom Content";
    //Specify that the group's content should be defined via the Content property
    group2.DisplaySource = DisplaySource.Content;

    //Create a StackPanel and specify it as the group's content
    StackPanel stackPanel = new StackPanel() { Orientation = Orientation.Horizontal };
    group2.Content = stackPanel;

    //Define the panel's content by creating two text blocks
    stackPanel.Children.Add(new TextBlock() {Text = "Selected Item: "});

    TextBlock textBlock2 = new TextBlock();
    Binding textBlockTextBinding = new Binding("SelectedItem.Content");
    textBlockTextBinding.Source = navBar; //textBlockTextBinding.Source = navBar.Groups[0];
    //The second text block displays the text of the NavBarControl's selected item
    textBlock2.SetBinding(TextBlock.TextProperty, textBlockTextBinding);


The following code snippets (auto-collected from DevExpress Examples) contain references to the DisplaySource property.


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.

See Also