NavBarControl.View Property
Gets or sets an object specifying the control’s paint style.
Namespace: DevExpress.XtraNavBar
Assembly: DevExpress.XtraNavBar.v19.1.dll
Declaration
Property Value
Type | Description |
---|---|
DevExpress.XtraNavBar.ViewInfo.BaseViewInfoRegistrator | A BaseViewInfoRegistrator object or descendant specifying the control’s paint style. |
Remarks
This property supports the internal infrastructure and typically is not intended to be used directly from your code.
At design time, you can change the control’s paint style via the Designer dialog.
To change the view via code, you can do the following:
- Assign the required View name to the NavBarControl.PaintStyleName property.
- Change the View type via the NavBarControl.PaintStyleKind property.
- Assign an appropriate registrator object defining the paint scheme to the View property. The list of available registrators can be obtained via the NavBarControl.AvailableNavBarViews property.
Example
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");
}
Related GitHub Examples
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.