Ejemplo n.º 1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            var p = new PersonInfo();
            var m = new QuestionVM();

            m.Info = "Введите имя:";
            var w = new Question(false);

            w.DataContext = m;
            w.ShowDialog();
            p.Name = m.Answer;
            _vm.Persons.Add(p);
        }
Ejemplo n.º 2
0
        private void FillAnswers(ITest test)
        {
            var r = new Random();

            test.Answers.Clear();
            for (int i = 0; i < test.QuestionsNumber; i++)
            {
                var m = new QuestionVM(test);
                m.Story = test.Story;
                m.Info  = "Вопрос #" + (i + 1);
                var w = new Question();
                w.DataContext = m;
                w.ShowDialog();
                //m.Answer = r.Next(1,3) + "";
                test.Answers.Add(int.Parse(m.Answer));
            }

            Update(test);
        }