The requested page is not available for the requested platform. You are viewing the content for Default platform.

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.1.dll

Declaration

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.

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