Specifies whether the BaseObjectSpace is marked as modified (see BaseObjectSpace.IsModified) when a non-persistent property is changed.
Namespace: DevExpress.ExpressApp
Assembly: DevExpress.ExpressApp.v19.2.dll
Type | Description |
---|---|
Boolean | true, to mark the Object Space as modified when a non-persistent property is changed; otherwise, false. The default is false. |
Type | Description |
---|---|
Boolean | true, to mark the Object Space as modified when a non-persistent property is changed; otherwise, false. The default is false. |
Type | Description |
---|---|
Boolean | true, to mark the Object Space as modified when a non-persistent property is changed; otherwise, false. The default is false. |
To set this property for all Object Spaces created by the application, handle the XafApplication.ObjectSpaceCreated event.
XAF Windows Forms Application - Program.cs (Program.vb) file:
public class Program {
//...
public static void Main(string[] arguments) {
//...
winApplication.Setup();
winApplication.ObjectSpaceCreated += winApplication_ObjectSpaceCreated;
winApplication.Start();
//...
}
static void winApplication_ObjectSpaceCreated(object sender, ObjectSpaceCreatedEventArgs e) {
BaseObjectSpace os = e.ObjectSpace as BaseObjectSpace;
if (os != null)
os.NonPersistentChangesEnabled = true;
}
}
Public Class Program
'...
Public Shared Sub Main(ByVal arguments() As String)
'...
winApplication.Setup()
AddHandler winApplication.ObjectSpaceCreated, AddressOf winApplication_ObjectSpaceCreated
winApplication.Start()
'...
End Sub
Private Shared Sub winApplication_ObjectSpaceCreated(ByVal sender As Object, _
ByVal e As ObjectSpaceCreatedEventArgs)
Dim os As BaseObjectSpace = TryCast(e.ObjectSpace, BaseObjectSpace)
If os IsNot Nothing Then
os.NonPersistentChangesEnabled = True
End If
End Sub
End Class
XAF ASP.NET Application - Global.asax.cs (Global.asax.vb) file:
public class Global : System.Web.HttpApplication {
//...
protected void Session_Start(object sender, EventArgs e) {
WebApplication.SetInstance(Session, new MySolutionWebApplication());
WebApplication.Instance.ObjectSpaceCreated += Instance_ObjectSpaceCreated
//...
WebApplication.Instance.Setup();
WebApplication.Instance.Start();
}
void Instance_ObjectSpaceCreated(object sender, ObjectSpaceCreatedEventArgs e) {
BaseObjectSpace os = e.ObjectSpace as BaseObjectSpace;
if (os != null)
os.NonPersistentChangesEnabled = true;
}
}
Public Class [Global]
Inherits System.Web.HttpApplication
'...
Protected Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
WebApplication.SetInstance(Session, New MySolutionWebApplication())
'...
AddHandler WebApplication.Instance.ObjectSpaceCreated, AddressOf Instance_ObjectSpaceCreated
WebApplication.Instance.Start()
End Sub
Private Sub Instance_ObjectSpaceCreated(ByVal sender As Object, _
ByVal e As ObjectSpaceCreatedEventArgs)
Dim os As BaseObjectSpace = TryCast(e.ObjectSpace, BaseObjectSpace)
If os IsNot Nothing Then
os.NonPersistentChangesEnabled = True
End If
End Sub
End Class