Quantcast
Channel: Data Binding in Collections
Viewing all articles
Browse latest Browse all 3

Data Binding in Collections

$
0
0
Hi,

As far as I know, for data binding to work for a collection you must implement the INotifyCollectionChanged for the simple reason that this collection exposes an event that notifies the UI that there are items remove/inserted in the collection.

The INotifyPropertyChanged is used to notify the UI that a specific Property in the business logic objects has changed.

So databinding to a collection that implements the INotifyCollectionChanged (containing objects that do not implement the INotifyPropertyChanged and the properties are not dependency properties) will still work since the UI is notified that the objects in the collection are changing yet if the object values change the UI will not be notified since your object is not implementing the INotifyProperty changed.

You have to keep in ming that you are doing 2 binding!

1. You are binding the ItemSource to the collection
2. every object in the collection is being bound in the data template accordingly

I hope this makes things more clear...

fell free to ask any other question

P.S WPF Data binding ROCKS



Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>