private void EditClick(object sender, RoutedEventArgs e)
        {
            if (CardGrid.SelectedItems.Count == 1)
            {
                string word = ((CardForDataGrid)CardGrid.SelectedItem).Word;
                Card oldCard = cards[word];
                cardsForDataGrid.Remove(cards[word].Data);
                cards.Remove(word);
                CardWindow cw = new CardWindow(oldCard);
                cw.Owner = this;

                if (cw.ShowDialog() == true) oldCard = cw.TheCard;

                cards.Add(oldCard.Word, oldCard);
                cardsForDataGrid.Add(oldCard.Data);

                CardGrid.ItemsSource = null;
                CardGrid.ItemsSource = cardsForDataGrid;
                CardGrid.SelectedItem = oldCard.Data;
            }
        }
        private void AddNewClick(object sender, RoutedEventArgs e)
        {
            CardWindow cw = new CardWindow(new Card() {
                Mode = 0,
                Word = "",
                Translations = new List<string>(),
                Shown = 0,
                Tested = 0
            });
            cw.Owner = this;

            if (cw.ShowDialog() == true)
            {
                cards.Add(cw.TheCard.Word, cw.TheCard);
                cardsForDataGrid.Add(cw.TheCard.Data);

                CardGrid.ItemsSource = null;
                CardGrid.ItemsSource = cardsForDataGrid;
                CardGrid.SelectedItem = cw.TheCard.Data;
            }
        }