What is the purpose of ObservableCollection raising a PropertyChange of ‘Item[]’?
Is this something I should be doing if I have a class that implements INotifyCollectionChanged?
Do WPF controls use this PropertyChange of ‘Item[]’ somehow?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ObservableCollectionimplements bothINotifyCollectionChangedandINotifyPropertyChanged.INotifyPropertyChangedis used to indicate that a property of theObservableCollectionhas changed, like the number of its elements ('Count') or an element accessible through the collection’s indexer ('Item[]'). Additionally,ObservableCollectionimplementsINotifyCollectionChangedto indicate which element has changed exactly and how.Have a look at the Mono implementation of
ObservableCollectionto see what theObservableCollectiondoes exactly. For example, here is theInsertItemmethod:If you want to implement your own
ObservableCollection-like collection class, it seems the proper way to implement bothINotifyCollectionChangedandINotifyPropertyChanged.