Skip to content

Instantly share code, notes, and snippets.

@juucustodio
Created September 14, 2018 01:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juucustodio/fbe3d3c6a44e433ecc499228444bc151 to your computer and use it in GitHub Desktop.
Save juucustodio/fbe3d3c6a44e433ecc499228444bc151 to your computer and use it in GitHub Desktop.
Example how to implement Infinite Scroll in Xamarin.Forms applications. - http://julianocustodio.com/listview-infinite-scroll
public MainViewModel()
{
Items = new InfiniteScrollCollection<string>
{
OnLoadMore = async () =>
{
IsBusy = true;
// Ler a proxima pagina
var page = Items.Count / PageSize;
//Busca os itens
var items = await _service.GetPessoasAsync(page, PageSize);
IsBusy = false;
// Itens que serão adicionados
return items;
}
};
Download();
}
public bool IsBusy
{
get => _isBusy;
set
{
_isBusy = value;
OnPropertyChanged();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment