public CreateQuizViewModel() { Quiz = new Quiz(); Questions = new ObservableCollection<Question>(); _questionRepository = new QuestionRepository(); }
private void BtnSaveQuiz_OnClick(object sender, RoutedEventArgs e) { var viewModel = this.DataContext as CreateQuizViewModel; if (viewModel == null) return; { Quiz quiz = new Quiz { Time = _totalTimeOfQuiz, SafeLimit = _safeLimit }; viewModel.SaveQuizCommand.Execute(quiz); } }