This question is locked. New answers and comments are not allowed.
From my observation, OnDemandAutomaticatic will trigger DataRequested when you scroll to the bottom of the list, but it will also trigger unexpectedly in some scenarios.
1. When the datacontext is not null and you change the DataVirtualizationMode to OnDemandAutomatic. This will trigger data requested. Sometimes it will trigger a second DataRequested event immediately after populating the list even with no user action. I believe this has to do with the listbox being in a pivot.
2. If a network error occurs while responding to DataRequested, the "loading.." animation will remain until you set it to OnDemandNone. Setting it to OnDemandNone defeats the point of automatic scroll. We should be able to tell it to cancel loading, just like we do with PullToRefresh.
3. The above two issues causes problems when restoreing the app from a Tombstoning.
(a). DataRequested is triggered before OnNavigatedTo is done restoring data. So I have to set the ListBox to OnDemandNone, then flip it to OnDemandAutomatic (and this can trigger a 2nd load).
(b) Sometimes the user does not have an internet connection when data is restored. So DataRequested fails but the loading animation just stays there and nothing happens after network conditions change.
My suggestion if you're going to keep it as is, please document explicitly when & what triggers a DataRequested event, including strategies for handling tombstones. (or just provide a way to cancel automatic loading in case it fails).
1. When the datacontext is not null and you change the DataVirtualizationMode to OnDemandAutomatic. This will trigger data requested. Sometimes it will trigger a second DataRequested event immediately after populating the list even with no user action. I believe this has to do with the listbox being in a pivot.
2. If a network error occurs while responding to DataRequested, the "loading.." animation will remain until you set it to OnDemandNone. Setting it to OnDemandNone defeats the point of automatic scroll. We should be able to tell it to cancel loading, just like we do with PullToRefresh.
3. The above two issues causes problems when restoreing the app from a Tombstoning.
(a). DataRequested is triggered before OnNavigatedTo is done restoring data. So I have to set the ListBox to OnDemandNone, then flip it to OnDemandAutomatic (and this can trigger a 2nd load).
(b) Sometimes the user does not have an internet connection when data is restored. So DataRequested fails but the loading animation just stays there and nothing happens after network conditions change.
My suggestion if you're going to keep it as is, please document explicitly when & what triggers a DataRequested event, including strategies for handling tombstones. (or just provide a way to cancel automatic loading in case it fails).