Back to Devexpress

DocumentManagerServiceExtensions.CreateDocument(IDocumentManagerService, String, Object, Object) Method

corelibraries-devexpress-dot-mvvm-dot-documentmanagerserviceextensions-dot-createdocument-x28-devexpress-dot-mvvm-dot-idocumentmanagerservice-system-dot-string-system-dot-object-system-dot-object-x29.md

latest3.2 KB
Original Source

DocumentManagerServiceExtensions.CreateDocument(IDocumentManagerService, String, Object, Object) Method

Static extension method that creates and returns a IDocument descendant with the specified parameters.

Namespace : DevExpress.Mvvm

Assembly : DevExpress.Mvvm.v25.2.dll

NuGet Packages : DevExpress.Mvvm, DevExpress.Win.Navigation

Declaration

csharp
public static IDocument CreateDocument(
    this IDocumentManagerService service,
    string documentType,
    object parameter,
    object parentViewModel
)
vb
<ExtensionAttribute>
Public Shared Function CreateDocument(
    service As IDocumentManagerService,
    documentType As String,
    parameter As Object,
    parentViewModel As Object
) As IDocument

Parameters

NameTypeDescription
serviceIDocumentManagerService

The type the static extension method operates with.

| | documentType | String |

A System.String value that specifies the type of the view to be created by the IDocumentManagerService.

| | parameter | Object |

A parameter passed to the view model via the ISupportParameter.Parameter property.

| | parentViewModel | Object |

An object that is passed to the view model of the created view via the ISupportParentViewModel.ParentViewModel property.

|

Returns

TypeDescription
IDocument

An object implementing the IDocument interface.

|

Remarks

This method creates a child View through the ViewLocator. The child View already contains a View Model. The Parameter (ISupportParameter) and ParentViewModel (ISupportParentViewModel) are passed to the child View Model. (ViewLocator, loosely-coupled View Models).

See Also

DocumentManagerServiceExtensions Class

DocumentManagerServiceExtensions Members

DevExpress.Mvvm Namespace