Skip to main content
All docs
V25.2
  • XafApplication.CreateObjectSpace<T>() Method

    Creates an Object Space of the specified type.

    Namespace: DevExpress.ExpressApp

    Assembly: DevExpress.ExpressApp.v25.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:

    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);
        }
    }
    

    The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateObjectSpace<T>() method.

    Note

    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