private void HungarianFlag_Click(object sender, RoutedEventArgs e)
 {
     BoxClearing();
     IsHungarian         = true;
     WordBox2.Foreground = Brushes.Black;
     word = dbDataHandler.SearchWord();
     WordBox1.AppendText(word.HungarianWord);
 }
 public Window1()
 {
     InitializeComponent();
     dbDataHandler       = new DbDataHandler(new WordDbContexts());
     WordBox1.IsReadOnly = true;
     word = dbDataHandler.SearchWord();
     WordBox1.AppendText(word.HungarianWord);
 }
 private void OnKeyDownHandler(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Return)
     {
         if (IsHungarian)
         {
             if (WordBox2.Text == word.SpanishWord)
             {
                 BoxClearing();
                 WordBox2.Foreground = Brushes.Black;
                 word = dbDataHandler.SearchWord();
                 WordBox1.AppendText(word.HungarianWord);
             }
             else
             {
                 WordBox2.Foreground = Brushes.Red;
                 WordBox2.Text       = word.SpanishWord;
             }
         }
         else
         {
             if (WordBox2.Text == word.HungarianWord)
             {
                 BoxClearing();
                 WordBox2.Foreground = Brushes.Black;
                 word = dbDataHandler.SearchWord();
                 WordBox1.AppendText(word.SpanishWord);
             }
             else
             {
                 WordBox2.Foreground = Brushes.Red;
                 WordBox2.Text       = word.HungarianWord;
             }
         }
     }
 }
 private void BoxClearing()
 {
     WordBox1.Clear();
     WordBox2.Clear();
 }