I am currently converting some code from Silverlight / WCF RIA Services to WPF / Entity Framework. The codebase made extensive use of the HasChanges property of the RIA domain context. The view is tied to this property to determine button states. For example, a form is bound to this HasChanges property, and whenever a user changes a property of any object inside a DomainContext , HasChanges will become true, and the Save and Discard buttons will turn on.
After some research, it is obvious that EF does not have an equivalent HasChanges property on an ObjectContext . Does anyone have any clever ideas on how to duplicate this functionality inside the Entity Framework?
I believe that these would be important functions for such a property:
- This new property
HasChanges becomes true whenever any property of any object loaded in the ObjectContext changes. HasChanges will become false whenever the SaveChanges method successfully ObjectContext .- The
HasChanges property throws a PropertyChanged event in which the view is caught to update the state of the buttons, etc.
Does anyone have any ideas? Maybe a custom EntityObject ADO.NET generator?
source share