.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

BaseObjectSpace.NonPersistentChangesEnabled Property

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

Declaration

public bool NonPersistentChangesEnabled { get; set; }
Public Property NonPersistentChangesEnabled As Boolean
public bool NonPersistentChangesEnabled { get; set; }
Public Property NonPersistentChangesEnabled As Boolean
public bool NonPersistentChangesEnabled { get; set; }
Public Property NonPersistentChangesEnabled As Boolean

Property Value

Type Description
Boolean

true, to mark the Object Space as modified when a non-persistent property is changed; otherwise, false. The default is false.

Property Value

Type Description
Boolean

true, to mark the Object Space as modified when a non-persistent property is changed; otherwise, false. The default is false.

Property Value

Type Description
Boolean

true, to mark the Object Space as modified when a non-persistent property is changed; otherwise, false. The default is false.

Remarks

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

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;
    }
}
See Also