Steps to reproduce
- Run the attached project.
- Create DomainObject1.
- Change the ProductionYear property.
- Click Save.
Current behavior
The editor's value is reset.
Current solutions
Use one of the following ways to resolve the issue in the current version:
- Set the WinApplication.UseOldTemplates property to False at startup. This property is set to True only in existing projects created before v14.2. The Solution Wizard enables new templates for all XAF WinForms applications created in v14.2 or later. We recommend using new templates when possible. We no longer fix bugs and develop new features for old templates.
OR
- Add the following controller to your application:
Visual BasicImports System.Windows.Forms
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Win.Core
Public Class CommitChangesController
Inherits ViewController
Public Sub New()
TargetViewNesting = Nesting.Root
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
AddHandler ObjectSpace.Committing, AddressOf ObjectSpace_Committing
End Sub
Private Sub ObjectSpace_Committing(ByVal sender As Object, ByVal e As EventArgs)
BindingHelper.EndCurrentEdit(CType(View.Control, Control))
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
RemoveHandler ObjectSpace.Committing, AddressOf ObjectSpace_Committing
End Sub
End Class
If options #1 and 2 do not help you
Make sure that you follow this best practice: PropertyChanged Event in Business Classes. Although you can temporarily restore the previous behavior using DetailView.RaiseObjectChangedOnControlValueChanged, I strongly recommend you fix your data model to follow the best practice - it will save your time and improve application performance in other places in the future. For more information, see Core - The IObjectSpace.ObjectChanged event is not raised in response to the editor's ControlValueChanged event.
IMPORTANT NOTES
To address synchronization issues with such feature toggles in different versions, XAF v20.2 ships with a unified feature selector: Core - FrameworkSettings.DefaultSettingsCompatibilityMode sets default XAF configuration options and feature toggles. I hope you find this helpful.