anagram4wander / VirtualizingObservableCollection

.NET PCL With Virtualizing Observable Collection
http://alphachitech.wordpress.com/2015/01/31/virtualizing-observable-collection/
57 stars 28 forks source link

Add issue in Demo application #14

Open Scantheus opened 8 years ago

Scantheus commented 8 years ago

I tested the ability to add to a collection by enabling the Dbg button and adding code to perform an add to DbgButton_Click (Commenting out the break). It adds an item to _items and then does an add to the collection (MyDataVirtualizedAsyncFilterSortObservableCollection.Add(newItem).

However, it caused a not implemented exception in GetItemsAt in RemoveOrDbDataSourceAsyncProxy.cs.

Steppoing through the code I found that FillPageFromAsyncProvider in PaginationManager.cs was calling GetItemsAt which, according to comments, is for sync only. If it is async, I believe it should call GetItemsAtAsync.

I commented out the GetItemsAt and added GetItemsAtAsync and the add now works.

// var data = this.ProviderAsync.GetItemsAt(pageOffset, newPage.ItemsPerPage, false); var data = this.ProviderAsync.GetItemsAtAsync(pageOffset, newPage.ItemsPerPage, false).Result;