Created
September 14, 2018 01:55
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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