Пример #1
0
        private void Yes_Click(object sender, RoutedEventArgs e)
        {
            var askName = new AskName(animal);

            askName.textName.Text += animal.Name + "?";
            askName.Show();
            allowClosing = true;
            Close();
        }
Пример #2
0
        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();
            }
        }