private void Yes_Click(object sender, RoutedEventArgs e) { var askName = new AskName(animal); askName.textName.Text += animal.Name + "?"; askName.Show(); allowClosing = true; Close(); }
private void No_Click(object sender, RoutedEventArgs e) { var index = Animals.AnimalsList.IndexOf(animal); var actualIndex = index + 1; if (Animals.AnimalsList.Count <= actualIndex) { var askName = new AskName(Animals.AnimalsList.FirstOrDefault()); askName.textName.Text += Animals.AnimalsList.FirstOrDefault().Name + "?"; askName.Show(); allowClosing = true; Close(); } else { var askBehavior = new AskBehavior(Animals.AnimalsList.ElementAt(actualIndex)); askBehavior.textBehavior.Text += Animals.AnimalsList.ElementAt(actualIndex).Behavior + "?"; askBehavior.Show(); allowClosing = true; Close(); } }