Skip to end of metadata
Go to start of metadata

Pull to refresh is a feature that allows you to refresh data using pull to refresh gesture. There are two types of refresh typically implemented in apps, full data refresh and incremental data refresh. 

Crosslight provides a built-in mechanism that allows you to easily enable pull-to-refresh feature in Crosslight apps. To learn more about pull-to-refresh concept in Crosslight, see Implementing Pull-to-Refresh.

On this page:

Full Data Refresh

Full data refresh means that all data will be reloaded again from server regardless of the currently loaded data. This approach is recommended if you have frequently changed data. 

To enable full data refresh, simply inherit your view model from DataListViewModelBase<TModel, TRepository> class and set the EnableRefresh property to true.

Incremental Data Refresh

Incremental data refresh means that only new data will be loaded after the last retrieval date. This approach typically compares the last retrieval date with the record's modified date which can be easily specified through a property set.

To enable full data refresh, you need to inherit your view model from DataListViewModelBase<TModel, TRepository> class and set both EnableRefresh and EnableIncrementalRefresh property to true. You also need to specify which property in your entity that represents the incremental date property using Crosslight Entity Designer Extensions. To learn how to specify incremental date metadata in your entity, see Creating Entity Model and Services with Crosslight Entity Designer Extensions.

The following code shows how to enable incremental data refresh in your view model.

The incremental refresh metadata is used to generate the filter expression when performing refresh data incremental. The following code snippet is taken from DataListViewModelBase<TModel, TRepository> that explains the usage of refresh metadata.

In most cases, you do not need to alter the refresh data implementation as the App Framework has taken care all the complex details. However, you can easily extend the existing functionality by overriding the desired methods.

Pull to Refresh View

In addition to frameworks, Crosslight also ships with pull-to-refresh UI components on every platform including iOS, Android and Windows Phone. The pull-to-refresh component is designed according to each respective platform's design guidelines.  For more information, see the following links.