Example #1
0
        public async Task refreshPageAsync()
        {
            if ((Cards.Count == 0) ||
                (Cards[0].cost != _cost) ||
                (Cards.Exists(p => p.playerClass != _class)))
            {
                var option = new CardQueryOption();
                option.AddHero(_class);
                // Neutral
                option.AddHero("None");
                option.AddCost(_cost);

                await CardData.GetCards(Cards, option);
            }

            AbstractCard empty = new AbstractCard();

            Board.Clear();

            for (int i = 0; i < Cards.Count; i++)
            {
                FindCardImage(Cards[i]);
                Board.Add(new DetailViewModel(Cards[i]));
            }

            OnPropertyChanged(nameof(this.Board));
        }