private async void lvwPokemons_Refreshing(object sender, EventArgs e) { PokemonListService.ClearListPokemon(); await SetItemSource(_pokemonGeracaoModel.PokemonMinimo, _pokemonGeracaoModel.PokemonMaximo); lvwPokemons.EndRefresh(); }
private async void SetPokemonPopularesList() { try { lvwPokemonFavoritos.ItemsSource = await PokemonListService.GetPokemonPopulares(); } catch (Exception ex) { await DisplayAlert("Erro ao carregar pokemons", ex.Message, "OK"); PokemonListService.ClearListPokemon(); await Navigation.PopAsync(); } }
private async Task SetItemSource(int PokemonMinimo, int PokemonMaximo) { try { lvwPokemons.ItemsSource = await PokemonListService.GetPokemonByIds(PokemonMinimo, PokemonMaximo); Content = _currentPage; } catch (Exception ex) { await DisplayAlert("Erro ao carregar pokemons", ex.Message, "OK"); PokemonListService.ClearListPokemon(); await Navigation.PopAsync(); } }
protected override void OnDisappearing() { base.OnDisappearing(); PokemonListService.ClearListPokemon(); }
protected override bool OnBackButtonPressed() { base.OnBackButtonPressed(); PokemonListService.ClearListPokemon(); return(false); }