private void ExecuteEditQuestionCommand(Object parameter)
        {
            var view = new TecherFormAddAndEditQuestions();
            var vm   = new AddEditQuestionViewModel();

            vm.Question = new Question()
            {
                Answers   = new List <Answer>(SelectedQuestion.Answers),
                Id        = SelectedQuestion.Id,
                Content   = SelectedQuestion.Content,
                Created   = SelectedQuestion.Created,
                Modifiyed = SelectedQuestion.Modifiyed,
                Image     = SelectedQuestion.Image
            };
            vm.AnswerCollection = new ObservableCollection <Answer>(vm.Question.Answers);

            vm.Window        = view;
            view.DataContext = vm;

            var result = view.ShowDialog();

            if (result.HasValue && result.Value)
            {
                vm.Question.Answers = new List <Answer>(vm.AnswerCollection);
                var editResult = DBDataSource.EditQuestion(vm.Question);
                if (editResult)
                {
                    QuestionCollection = new ObservableCollection <Question>(DBDataSource.GetQuestions());
                }
            }
        }
        private void ExecuteNewQuestionCommand(Object parameter)
        {
            var view = new TecherFormAddAndEditQuestions();
            var vm   = new AddEditQuestionViewModel();

            vm.Question      = new Question();
            vm.IsNewQuestion = true;
            vm.Window        = view;
            view.DataContext = vm;

            var result = view.ShowDialog();

            if (result.HasValue && result.Value)
            {
                vm.Question.Answers = new List <Answer>(vm.AnswerCollection);
                var questionid = DBDataSource.AddNewQuestion(vm.Question, NavigationHelper.CurrrentTest.Id);
                if (questionid > 0)
                {
                    //Добавление вопроса в UI
                    vm.Question.Id = questionid;
                    QuestionCollection.Add(vm.Question);
                }
            }
        }