BindableCollection<T>: Add Saftey

Jul 27, 2010 at 6:02 PM

Hi Again

I have seen issue Ticket #13 and have read the provided articels. I wonder why "Add" isnt exectued on the UI Thread (AddRange also calls Add and didnt call it on the UI thread). Why is that so?

Thanks
Michael

 

Coordinator
Jul 27, 2010 at 6:29 PM

I could be wrong, but I though Add actually used SetItem or InsertItem under the covers.

Jul 27, 2010 at 7:06 PM

Thanks a lot for the fast reply. Ok - then i understand ;)

Jul 28, 2010 at 7:19 AM
Edited Jul 28, 2010 at 7:19 AM
I can confirm that the Add function is indeed implemented as an Insert, whose index is equal to the current Count of the collection. Such implementation is inherited by Collection<T>, and thus by ObservableCollection<T>.