Xamarin.Forms Infinite Scrolling ListView Example

Hello! It is being a long time since I post something, so here it goes:

It was always a "pain" trying to add an infinite ListView using Xamarin.Forms but with Matthew Leibowitz's NuGet package this process is now very simple.

For the purpose of this example I will create a new blank Xamarin.Forms project.

0.- Add the (Awesome) NuGet package:

1.- Create your ListView page, the key point here is the footer loading template and the InfiniteScrollBehavior:

2.- Create your View Model, Here is the most important part of the whole process.

It is important to note that I am mocking a server side call just for the purpose of this tutorial.

The InfiniteScrollCollection object and the OnLoadMore event will do the trick for the infinite scroll event, so what ever you need to do to load more items, do it inside the OnLoadMore event, typically you will send the next page of the collection size to the server side and the server will answer back with the correct response that will contain the next items to show on the list:

3.- Assign the ViewModel to the view:

In "three" steps you can add a infinite loading list view to your applications without any delay. Let me know any comments or issues in the comment sections below:

As always the source code is right here:

Thanks to Matthew Leibowitz.

Mario Jesús Galván Miranda

I am a Mexican Mobile developer and a Xamarin Enthusiast.