Esempio n. 1
0
        private void tabPlayer_GotFocus(object sender, RoutedEventArgs e)
        {
            if (((TabItem)sender).Visibility == Visibility.Visible)
            {
                try
                {
                    if (dgCardsAvailable.ItemsSource == null || _cardUpdated == true)
                    {
                        dgCardsAvailable.ItemsSource = _cardManager.RetreiveAllCards();

                        dgCardsAvailable.Columns[0].Header  = "Card ID";
                        dgCardsAvailable.Columns[1].Header  = "Card Name";
                        dgCardsAvailable.Columns[2].Header  = "Card Category";
                        dgCardsAvailable.Columns[3].Header  = "Card Type";
                        dgCardsAvailable.Columns[4].Header  = "Monster Type";
                        dgCardsAvailable.Columns[5].Header  = "Monster SubType";
                        dgCardsAvailable.Columns[6].Header  = "Monster Attribute";
                        dgCardsAvailable.Columns[7].Header  = "Level / Rank";
                        dgCardsAvailable.Columns[8].Header  = "Attack";
                        dgCardsAvailable.Columns[9].Header  = "Defense";
                        dgCardsAvailable.Columns[10].Header = "Pendulum Scale";
                        dgCardsAvailable.Columns[11].Header = "Link Number";
                        dgCardsAvailable.Columns[12].Header = "Banlist Placement";
                        dgCardsAvailable.Columns[13].Header = "Card Text";
                        _cardUpdated = false;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message + "\n\n" + ex.InnerException.Message);
                }
            }
        }