Adding pull-to-refresh
As with the new entry page, when the main page is loading our data, we should present the user with a loading indicator so that they know their list of entries is on its way. However, since the main page is using a data-bound CollectionView
instead of a static TableView
, we can surround the CollectionView
with a RefreshView
to easily add pull-to-refresh functionality.
Pull-to-refresh also has the benefit of allowing users to easily refresh the screen and load any new data that might be available. Xamarin.Forms makes adding pull-to-refresh very easy, and we will still use the IsBusy
property from our BaseViewModel
, just as we did on the new entry page.
The Xamarin.Forms RefreshView
API requires two things: an ICommand
that handles refreshing the bound source of the scrollable element it surrounds (in our case, this is a CollectionView
), and a boolean field that indicates whether the RefreshView
is currently refreshing or not. To add pull-to-refresh, perform...