示例#1
0
        public void TestGetAllService()
        {
            var pokedexService = new PokedexService();
            var response       = pokedexService.GetAll();

            Assert.IsTrue(response.Count > 0, "should have at least 1 pokemon");
        }
        public async Task LoadPokedex()
        {
            IsLoading = true;

            Pokedex = await PokedexService.GetPokemon();

            PokemonList = new ObservableCollection <Pokemon>(Pokedex);

            IsLoading = false;
        }
        public async Task LoadIceDarkPokedex()
        {
            IsLoading = true;

            Pokedex = await PokedexService.GetPokemon();

            IcePokemonList  = new ObservableCollection <Pokemon>(Pokedex.Where(x => x.Types.Contains("Ice")));
            DarkPokemonList = new ObservableCollection <Pokemon>(Pokedex.Where(x => x.Types.Contains("Dark")));

            IsLoading = false;
        }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 /// <remarks>RWM: DO NOT call this constructor at runtime!</remarks>
 public MainPageViewModel()
 {
     if (DesignMode.DesignModeEnabled)
     {
         Value = "Designtime value";
         if (PokedexService == null)
         {
             PokedexService = new PokedexService(new PokemonGoApiClient());
         }
         PokedexService.PokedexInventory.Add(new PokemonData("Abra"));
         PokedexService.PokedexInventory.Add(new PokemonData("Pikachu"));
         PokedexService.PokemonInventory.Add(new PokemonData("Abra"));
     }
 }
示例#5
0
 /// <summary>
 ///
 /// </summary>
 /// <remarks>RWM: DO NOT call this constructor at runtime!</remarks>
 public MainPageViewModel()
 {
     if (DesignMode.DesignModeEnabled)
     {
         Value = "Designtime value";
         if (PokedexService == null)
         {
             PokedexService = new PokedexService(new PokemonGoApiClient(null, null, null));
         }
         PokedexService.PokedexInventory.Add(new PokemonData {
             PokemonId = PokemonId.Abra
         });
         PokedexService.PokedexInventory.Add(new PokemonData {
             PokemonId = PokemonId.Charmander
         });
         PokedexService.PokedexInventory.Add(new PokemonData {
             PokemonId = PokemonId.Pikachu
         });
     }
 }
示例#6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="pokedexService"></param>
 /// <remarks>RWM: This is the constructor you call at runtime.</remarks>
 public MainPageViewModel(PokedexService pokedexService) : this()
 {
     PokedexService = pokedexService;
 }