EntityContentsChanged and PropertyChanged differences?

Posts   
 
    
Kazak1
User
Posts: 39
Joined: 30-May-2006
# Posted on: 09-Aug-2006 01:38:49   

What are the differences between EntityContentsChanged and PropertyChanged events? When should I use what?

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 09-Aug-2006 03:43:14   

.NET 2.0: Entities no longer expose FieldNameChanged events. Instead they expose PropertyChanged, a general event exposed by the INotifyPropertyChanged interface, which is new in .NET 2.0. Code which should notify a control of a changed property, should use the new OnPropertyChanged(propertyName) method.

During databinding, when an edit cycle is in progress (row editing in grid): EntityContentsChanged event of an entity is now raised after EndEdit has been completed. This means that EntityContentsChanged is raised if a new row is been selected. A containing collection won't be notified until this event is raised.