public PlatformGameListViewModel() { IsRefreshing = false; RefreshCommand = new Command(async() => { IsRefreshing = true; await PopulateData(false); IsRefreshing = false; }); ItemAppearingCommand = new Command <Models.Juego>(execute: async(Models.Juego juego) => { if (IsLoadingMoreData) { return; } if (juego == JuegosResult.Last() && LoadedElementCount < MaxLoadedElements) { IsLoadingMoreData = true; await PopulateData(true); IsLoadingMoreData = false; } }); }
public SearchPageViewModel() { IsRefreshing = false; RefreshCommand = new Command(async() => { IsRefreshing = true; await PopulateData(false); IsRefreshing = false; }); ItemAppearingCommand = new Command <Models.Juego>(execute: async(Models.Juego juego) => { if (IsLoadingMoreData) { return; } if (juego == JuegosResult.Last() && LoadedElementCount < MaxLoadedElements) { IsLoadingMoreData = true; await PopulateData(true); IsLoadingMoreData = false; } }); SearchCommand = new Command <string>(execute: async(string text) => { if (string.IsNullOrEmpty(text) || string.IsNullOrWhiteSpace(text)) { return; } SearchQuery = text; IsRefreshing = true; await PopulateData(false); IsRefreshing = false; }); }