Skip to main content
All docs
V24.2
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XafApplication.CreateObjectSpace<T>() Method

Creates an Object Space of the specified type.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public IObjectSpace CreateObjectSpace<T>()

#Type Parameters

Name Description
T

Object type.

#Returns

Type Description
IObjectSpace

An IObjectSpace object.

#Remarks

For more information about creating an Object Space of the specified type, refer to the following topic: CreateObjectSpace(Type).

The following code demonstrates how to implement a PopupWindowShowAction to create a new Note object:

C#
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.Persistent.Base;
using YourSolutionName.Module.BusinessObjects;

namespace YourSolutionName.Blazor.Server.Controllers;
public class ShowNotesController : WindowController {
    public ShowNotesController() {
        PopupWindowShowAction showNotesAction = new PopupWindowShowAction(this, "ShowNotes", PredefinedCategory.Edit);
        showNotesAction.CustomizePopupWindowParams += ShowNotesAction_CustomizePopupWindowParams;
    }
    private void ShowNotesAction_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e) {
        IObjectSpace objectSpace = Application.CreateObjectSpace<Note>();
        var note = objectSpace.CreateObject<Note>();
        e.View = Application.CreateDetailView(objectSpace, note);
    }
}
See Also