The incremental loading is the process of loading data in small chunks instead of the entire set of data. Imagine you a small number of records, perhaps 10,000 records. When the user navigates to the view model, then the process of loading 10,000 records data starts, it will take a long time for the operation to complete. The incremental loading technique is an excellent approach to tackle this scenario. Instead of loading everything at once, it is more preferable loading data in small chunks. The incremental loading technique is used because of several advantages:
- Takes a less toll on the server in providing the data to the client.
- Takes a better toll on battery life.
- Lightweight data loading, therefore using lighter bandwidth.
- Provides data just when the user needs it.
To enable incremental loading with the App Framework, simply inherit your view model from DataListViewModelBase<TModel, TRepository> class and set the EnableIncrementalLoading property to true. You might also want to configure other properties such as IncrementalLoadingSize, ViewQuery, etc to customize the incremental loading behaviors to suit your needs.
The following code shows you how to create a view model with incremental loading enabled.