Skip to main content

DocumentManagerServiceExtensions.FindDocumentByIdOrCreate(IDocumentManagerService, Object, Func<IDocumentManagerService, IDocument>) Method

Static extension method that retrieves the document by the specified identifier. If a document with such an identifier does not exist, it will be created.

Namespace: DevExpress.Mvvm

Assembly: DevExpress.Mvvm.v24.1.dll

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

Declaration

public static IDocument FindDocumentByIdOrCreate(
    this IDocumentManagerService service,
    object id,
    Func<IDocumentManagerService, IDocument> createDocumentCallback
)

Parameters

Name Type Description
service IDocumentManagerService

The type the static extension method operates with.

id Object

An System.Object object that represents the document’s IDocument.Id.

createDocumentCallback Func<IDocumentManagerService, IDocument>

A System.Func object specifying the Callback function of the document creation.

Returns

Type Description
IDocument

An object implementing the IDocument interface.

Remarks

To learn more about Callback functions, refer to Callback Functions.

See Also