All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
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+

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.v21.1.dll

Declaration

public void PopulateAdditionalObjectSpaces(
    XafApplication application
)

Parameters

Name Type Description
application XafApplication

An XAF application instance where Object Space Providers are registered.

Remarks

Follow the steps below to use this method:

  1. Handle the XafApplication.ObjectSpaceCreated event in a module or Controller.
  2. In the event handler, call the PopulateAdditionalObjectSpaces(XafApplication) method to populate the AdditionalObjectSpaces collection with all necessary Object Spaces.

The following example demonstrates how to do this in a platform-agnostic module (MySolution.Module/Module.cs(vb)):

using DevExpress.ExpressApp;
//...
public class MySolutionModule : ModuleBase {
    //...
    public override void Setup(XafApplication application) {
        base.Setup(application);
        application.ObjectSpaceCreated += Application_ObjectSpaceCreated;
    }
    private void Application_ObjectSpaceCreated(object sender, ObjectSpaceCreatedEventArgs e) {
        CompositeObjectSpace compositeObjectSpace = e.ObjectSpace as CompositeObjectSpace;
        if (compositeObjectSpace != null) {
            if (!(compositeObjectSpace.Owner is CompositeObjectSpace)) {
                compositeObjectSpace.PopulateAdditionalObjectSpaces((XafApplication)sender);
            }
        }
    }
}
See Also