NavBarControl.AvailableNavBarViews Property

Provides access to the collection of BaseViewInfoRegistrator objects which contain information on painting corresponding Views.

Namespace: DevExpress.XtraNavBar

Assembly: DevExpress.XtraNavBar.v20.1.dll

Declaration

[Browsable(false)]
public virtual NavBarViewCollection AvailableNavBarViews { get; }
<Browsable(False)>
Public Overridable ReadOnly Property AvailableNavBarViews As NavBarViewCollection

Property Value

Type Description
DevExpress.XtraNavBar.NavBarViewCollection

A DevExpress.XtraNavBar.NavBarViewCollection collection that contains BaseViewInfoRegistrator objects.

Remarks

The XtraNavBar control encapsulates the paint settings for views in the DevExpress.XtraNavBar.ViewInfo.BaseViewInfoRegistrator class descendants.

The AvailableNavBarViews property provides access to the collection of these objects, which contain paint information for all the available Views in a NavBarControl. You can access a specific object using the indexer properties provided by the collection. It is possible to refer to an item using a zero-based index or the View's name. Below are some of the existing View names:

"BaseView",

"FlatView",

"Office1View",

"Office2View",

"Office3View",

"VSToolBoxView",

"AdvExplorerBarView",

"ExplorerBarView",

"UltraFlatExplorerBarView",

"SkinExplorerBarView",

"XP1View",

"XP2View",

"XPExplorerBarView",

"NavigationPane",

"SkinNavigationPane",

"Skin:Caramel",

"Skin:Money Twins",

"Skin:Lilian",

"Skin:The Asphalt World",

"Skin:iMaginary",

"Skin:Black",

"Skin:Blue",

"SkinNav:Caramel",

"SkinNav:Money Twins",

"SkinNav:Lilian",

"SkinNav:The Asphalt World",

"SkinNav:iMaginary",

"SkinNav:Black",

"SkinNav:Blue",

Typically, you do not need to use the AvailableNavBarViews property, unless you want to add a customView to a NavBarControl.

To change the View for the navbar, use the NavBarControl.PaintStyleName or NavBarControl.PaintStyleKind property.

Examples

The following sample code applies all available paint style to the NavBarControl sequentially. A message box is displayed after each style is applied.

The NavBarControl.AvailableNavBarViews property is used to obtain the list of Views available for the control. Each View is applied to the control via the NavBarControl.View property.

using DevExpress.XtraNavBar.ViewInfo;
//...
for (int i = 0; i < navBarControl1.AvailableNavBarViews.Count; i++) {
   BaseViewInfoRegistrator vir = 
     navBarControl1.AvailableNavBarViews[i] as BaseViewInfoRegistrator;
   navBarControl1.View = vir;
   MessageBox.Show("The " + vir.ViewName + " painting style.", "Information");
}
See Also