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.v14.2.dll

#Declaration

public NavBarViewBase View { get; set; }

#Property Value

Type Description
NavBarViewBase

A NavBarViewBase descendant, specifying the control 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;
See Also