All docs
V20.2
20.2 (EAP/Beta)
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+
You are viewing help content for pre-release software. This document and the features it describes are subject to change.

CompositeObjectSpace.PopulateAdditionalObjectSpaces(XafApplication) Method

Creates Object Spaces for registered Object Space Providers and adds them to the AdditionalObjectSpaces collection. Object Spaces in this collection are automatically disposed of with the owner Object Space.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v20.2.dll

Declaration

public void PopulateAdditionalObjectSpaces(
    XafApplication application
)
Public Sub PopulateAdditionalObjectSpaces(
    application As XafApplication
)

Parameters

Name Type Description
application XafApplication

An XAF application instance where Object Space Providers are registered.

Remarks

The following example shows how to use this method in a WinForms Module:

using System;
using System.ComponentModel;
using DevExpress.ExpressApp;
// ...
public sealed partial class MySolutionWinModule : ModuleBase {
    // ...
    public override void Setup(XafApplication application) {
        base.Setup(application);
        application.SetupComplete += Application_SetupComplete;
        // ...
    }
    private void Application_SetupComplete(object sender, EventArgs e) {
        Application.ObjectSpaceCreated += Application_ObjectSpaceCreated;
        // ...
    }
    private void Application_ObjectSpaceCreated(object sender, ObjectSpaceCreatedEventArgs e) {
        CompositeObjectSpace objectSpace = e.ObjectSpace as CompositeObjectSpace;
        if (objectSpace != null) {
            if (!(objectSpace.Owner is CompositeObjectSpace)) {
                objectSpace.PopulateAdditionalObjectSpaces((XafApplication)sender);
            }
        }
    }
}
See Also