コード例 #1
0
        private void GetRelevantQuestions()
        {
            if (SelectedQuiz != null)
            {
                // id van quizz ophalen
                // haal alle question die quiz id bevatten
               List<int> tempQuizlist = Context.Quizzenlijst.Where(q => q.QuizId == SelectedQuiz.Id).Select(q => q.QuestionId).ToList();

                RelevantQuestions = new ObservableCollection<QuestionVM>();
                foreach (int question in tempQuizlist)
                {
                    QuestionVM temp = new QuestionVM(Context.Questions.First(q => q.Id == question));
                    RelevantQuestions.Add(temp);
                }
                RaisePropertyChanged("RelevantQuestions");
            }
        }
コード例 #2
0
 private void ShowAddQuestion()
 {
     SelectedQuestion = new QuestionVM();
     AddQuestionWindow = new AddQuestionWindow();
     AddQuestionWindow.Show();
 }