Skip to main content
All docs
.NET Framework 4.5.2+

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.v22.2.dll

NuGet Package: DevExpress.ExpressApp


public void PopulateAdditionalObjectSpaces(
    XafApplication application


Name Type Description
application XafApplication

An XAF application instance where Object Space Providers are registered.


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) {
        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)) {

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


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.

See Also