Example #1
0
        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();
            }
        }
Example #3
0
        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();
            }
        }
Example #4
0
 protected override void OnDisappearing()
 {
     base.OnDisappearing();
     PokemonListService.ClearListPokemon();
 }
Example #5
0
 protected override bool OnBackButtonPressed()
 {
     base.OnBackButtonPressed();
     PokemonListService.ClearListPokemon();
     return(false);
 }