-
Notifications
You must be signed in to change notification settings - Fork 27
Description
VirtualizingObservableCollection.Add calls InternalAdd, which uses the Provider or ProviderAsync as IEditableProvider. In this case, that method is PaginationManager.OnAppend. PaginationManager.OnAppend determines the page to use. If the call to IsPageWired succeeds, the item gets added. Otherwise, it does not. In both cases, the _LocalCount gets updated, and for cases where the provider is async, a test GetAt is performed - that function will ultimately call SafeGetPage, which will cause the page to get "wired"
The result is, the 0th item does not get added because the page is not "wired", but subsequent items for async providers get added because the test GetAt wires the page via a call to SafeGetPage.
OnInsert, OnRemove and OnReplace all follow that pattern. Is there any reason to not just call SafeGetPage instead of the "wired" check?
I am using an asynchronous provider derived from PagedSourceProviderMakeAsync where I have implemented _FuncGetItemsAt and friends to retrieve records from cache as requested. Should I be using Add, Insert, etc. functions on the VisualiziingObservableCollection object? So far, that is the only way I have found I can make the item count update without calling OnReset with either -1 or my packet count, which results in bad things when receiving data at a high rate....