expressappframework-devexpress-dot-expressapp-dot-xafapplication-dot-createobjectspace-1.md
Creates an Object Space of the specified type.
Namespace : DevExpress.ExpressApp
Assembly : DevExpress.ExpressApp.v25.2.dll
NuGet Package : DevExpress.ExpressApp
public IObjectSpace CreateObjectSpace<T>()
Public Function CreateObjectSpace(Of T) As IObjectSpace
| Name | Description |
|---|---|
| T |
Object type.
|
| Type | Description |
|---|---|
| IObjectSpace |
An IObjectSpace object.
|
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.
protected void ShowFilterDialog() {
NonPersistentObjectSpace nonPersistentObjectSpace = (NonPersistentObjectSpace)Application.CreateObjectSpace<ViewFilterContainer>();
IObjectSpace persistentObjectSpace = Application.CreateObjectSpace<ViewFilterObject>();
var duplicatesDictionary = GetDuplicatesDictionary();
var nonPersistentObjectSpace = Application.CreateObjectSpace<DuplicatesList>();
var duplicatesList = CreateDuplicatesList(duplicatesDictionary, nonPersistentObjectSpace);
restorePasswordLogonAction.CustomizePopupWindowParams += (s, e) => {
var objectSpace = Application.CreateObjectSpace<SetNewPasswordParameters>();
var newPasswordParameters = objectSpace.CreateObject<SetNewPasswordParameters>();
See Also