private async void BlockButton_Click(object sender, RoutedEventArgs e) { foreach (Button bt in bts) { bt.Background = Brushes.CadetBlue; } Button clickButt = sender as Button; if (String.Equals(clickButt.Content, enWords[wordIteration])) { blocks.Children.Remove(clickButt); tbs[wordIteration].Text = enWords[wordIteration].ToString(); tbs[wordIteration].Visibility = Visibility.Visible; wordIteration++; if (wordIteration == enWords.Length && correctAnswer) { await MyDataBase.ChangeOfferPriority(id, offers[offerIteration].En, -1); foreach (TextBlock tb in tbs) { tb.Background = Brushes.Green; } } } else { correctAnswer = false; clickButt.Background = Brushes.Red; } }
private async void Button_Click(object sender, RoutedEventArgs e) { await MyDataBase.ChangeOfferPriority(id, enLabel.Text.ToString(), -10); ((Button)sender).Background = Brushes.Green; }