Back to Devexpress

DocumentManager.CreateView(ViewType) Method

windowsforms-devexpress-dot-xtrabars-dot-docking2010-dot-documentmanager-dot-createview-x28-devexpress-dot-xtrabars-dot-docking2010-dot-views-dot-viewtype-x29.md

latest4.4 KB
Original Source

DocumentManager.CreateView(ViewType) Method

Creates a BaseView object for the current DocumentManager.

Namespace : DevExpress.XtraBars.Docking2010

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public virtual BaseView CreateView(
    ViewType type
)
vb
Public Overridable Function CreateView(
    type As ViewType
) As BaseView

Parameters

NameTypeDescription
typeViewType

The ViewType enumerator value specifying the type of view created.

|

Returns

TypeDescription
BaseView

The BaseView object created.

|

Remarks

A DocumentManager component has multiple Views to present documents. The current DocumentManager‘s view is the one assigned to the DocumentManager.View property. All DocumentManager‘s views are accessible via the DocumentManager.ViewCollection property.

The CreateView method creates a new view, whose type is specified via the type parameter. The newly created view is placed neither to the DocumentManager.ViewCollection nor applied to the parent DocumentManager as the active view. Use the method’s return value to perform any of these operations manually.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CreateView(ViewType) method.

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.

winforms-create-custom-document-manager/CS/CustomDocument/Custom DocumentManager/CustomDocumentManager.cs#L26

csharp
if (type == ViewType.Widget) return new CustomWidgetView(Container);
    return base.CreateView(type);
}

winforms-create-custom-document-manager/VB/CustomDocument/Custom DocumentManager/CustomDocumentManager.vb#L30

vb
End If
    Return MyBase.CreateView(type)
End Function

See Also

View

ViewCollection

Views

DocumentManager Class

DocumentManager Members

DevExpress.XtraBars.Docking2010 Namespace