Exemplo n.º 1
0
        private void ChangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var comboBox = sender as ComboBox;
            string deckName = comboBox.SelectedItem as string;

            if (deckName == "--- New ---")
            {
                var deckCreationWindow = new DeckCreation(Library.AllCardNames(), new DeckCreationDelegate(deckCollection.AddDeck));
                deckCreationWindow.Show();
                deckCreationWindow.Closed += new EventHandler((window, args) =>
                {
                    PopulateChangeComboBox(comboBox);
                });
            }
            else
            {
                InitializeDeck(deckName);
            }
        }
Exemplo n.º 2
0
        private void ChangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var    comboBox = sender as ComboBox;
            string deckName = comboBox.SelectedItem as string;

            if (deckName == "--- New ---")
            {
                var deckCreationWindow = new DeckCreation(Library.AllCardNames(), new DeckCreationDelegate(deckCollection.AddDeck));
                deckCreationWindow.Show();
                deckCreationWindow.Closed += new EventHandler((window, args) =>
                {
                    PopulateChangeComboBox(comboBox);
                });
            }
            else
            {
                InitializeDeck(deckName);
            }
        }