Binding WPF DataGrid directly to EntityCollection <T>
I understand how wpf supports automatic updating of DataGrids and Listboxes (i.e. adding new items and deleting deleted ones) with the INotifyCollectionChanged interface that implements ObservableCollection. For some reason, however, I seem to have achieved the full success of binding to EntityCollection<T> from EntityFramework, which does not seem to implement INotifyCollectionChanged . Is there any other way to WPF?
I just wanted to know how this works.
EDIT
Here is the relevant part of the answer. The short form is that it "just works" with WPF and WinForms bindings.
EntityCollection does not currently implement INotifyCollectionChanged, which is the "new" standard interface for notifying changes to a collection. However, the list of bindings that you can get for EntityCollection (and which, as a rule, when you go through EntityCollection as a data source) is an IBindingList which has its own "old" standard way of notifying about changes in the collection (namely, the ListChanged event). In general, WinForms and data binding WPF knows how to work with this interface.
Apparently, there was an error on it but it was closed as "by design" (at least not for .NET 4).
As this post explains, EntityCollection effectively uses the "old" or WinForms notification method of a list change that uses an IBindingList. Although WPF uses the "new" INotifyCollectionChanged interface.
You can take a look at the EntityObservableCollection, which can be found in the WPL Application Framework (WAF) sample BookLibrary . This ensures that the WPF binding recognizes all updates.