Skip to main content

NavBarControl.View Property

Gets or sets an object specifying the control’s display style. This is a dependency property.

Namespace: DevExpress.Xpf.NavBar

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

NuGet Package: DevExpress.Wpf.NavBar

Declaration

public NavBarViewBase View { get; set; }

Property Value

Type Description
NavBarViewBase

A NavBarViewBase descendant specifying the control’s view used to display data.

Remarks

Use the View property to control how the NavBarControl’s groups and their contents are displayed on screen. By default, when the NavBarControl is created, it initializes the View property with a ExplorerBarView object.

At design time, you can change the control’s view by setting the View property within the Properties Window. Or, you can do this in XAML:

<dxn:NavBarControl Name="navBarControl1">
            <dxn:NavBarControl.View>
                <dxn:NavigationPaneView ActiveGroupMinHeight="200"/>
            </dxn:NavBarControl.View>

            <dxn:NavBarControl.Groups>
                <dxn:NavBarGroup Header="Group1">
                    <dxn:NavBarItem>Item1</dxn:NavBarItem>
                </dxn:NavBarGroup>
                <dxn:NavBarGroup Header="Group2">
                    <dxn:NavBarItem>Item1</dxn:NavBarItem>
                    <dxn:NavBarItem>Item2</dxn:NavBarItem>
                </dxn:NavBarGroup>
            </dxn:NavBarControl.Groups>
        </dxn:NavBarControl>

To change the control’s view in code, you should create a new instance of the required view object (SideBarView, NavigationPaneView, or ExplorerBarView) and assign it to the View property.

using DevExpress.Xpf.NavBar;

//...
        NavigationPaneView navPaneView = new NavigationPaneView();
        navPaneView.ActiveGroupMinHeight = 200;
        navBarControl1.View = navPaneView;

To learn more, see the Views topic.

The following code snippets (auto-collected from DevExpress Examples) contain references to the View 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.

See Also