Ejemplo n.º 1
0
        async public void RemoveCard(object sender, EventArgs e)
        {
            ShownCard = (MTGCard)this.BindingContext;
            await App.CardDB.DeleteCardAsync(ShownCard);

            await Navigation.PushModalAsync(new NavigationPage(new MainPage()));
        }
Ejemplo n.º 2
0
 public CardView()
 {
     InitializeComponent();
     ShownCard = (MTGCard)this.BindingContext;
     int Index = App.IndexClicked;
     //GetDBCards(Index);
 }
Ejemplo n.º 3
0
 public Task <int> SaveCardAsync(MTGCard card)
 {
     if (card.ID != 0)
     {
         return(_database.UpdateAsync(card));
     }
     else
     {
         return(_database.InsertAsync(card));
     }
 }
Ejemplo n.º 4
0
        public void PutCardsInListView(List <Card> jsonCards)
        {
            foreach (Card c in jsonCards)
            {
                MTGCard ModelCard = new MTGCard();
                ModelCard.name     = c.name;
                ModelCard.imageURL = c.imageUrl;
                responseCards.Add(ModelCard);
            }

            //searchResults.ItemsSource = responseCards;
        }
Ejemplo n.º 5
0
        async public void GetDBCards(int index)
        {
            var cardsTemp = await App.CardDB.GetCardsAsync();

            cards = new ObservableCollection <MTGCard>(cardsTemp);
            this.BindingContext = cards;
            //bug fix
            foreach (MTGCard card in cards)
            {
                if (ShownCard.imageURL == card.imageURL)
                {
                    ShownCard = card;
                }
            }

            //ShownCard = cards[index];
            viewCard.BindingContext = ShownCard;
        }
Ejemplo n.º 6
0
 public Task <int> DeleteCardAsync(MTGCard card)
 {
     return(_database.DeleteAsync(card));
 }