Press "Enter" to skip to content

Xamarin Forms Lazy Loading(Infinite Scroll)

When we are making an app, we add some features to make application have better design. One of the feature is that Lazy Loading. Lazy loading works like, When we have a list view and we have specific number item, we scroll the screen and then other items appear in that specific number.

I made a simple application to show how to use lazy loading. In this application, There are information about the football players, Their names, pictures and teams. I created a class and initialize the variables that i use. Then i created a list and then i sent the data to that list, later i created a function like that;

Thanks to this function, i make the how many items will be in the page. I added the Xamarin.Forms.Extended.InfiniteScrolling nuget package to the my application. Later, I created a class model to make binding process and i inherited this class from the INotifyPropertyChanged interface. I wrote these codes to the class;

From this codes, I used boolean isBusy which is controlled the user action. Also i determine number of the items in the page which is 10. Then i created an object from my data service and also i created an from InfiniteScrollCollection<Player> Players. Later i wrotes some functions that controlled process of the lazy loading in the class. I also make a really simple design for the application.

Here is the view of the application;

2 Comments

  1. Can you share DataServiceController me a favor? please

    • Ebubekir Sezer Ebubekir Sezer

      You can check the project by clicking here.

Leave a Reply

Your email address will not be published. Required fields are marked *