public TriviaGameQuestionViewModel(TriviaGameEditorControlViewModel control, TriviaGameQuestion question) : this(control) { this.Question = question.Question; this.CorrectAnswer = question.CorrectAnswer; for (int i = 0; i < question.WrongAnswers.Count; i++) { this.WrongAnswers[i] = question.WrongAnswers[i]; } }
public TriviaGameQuestion GetQuestion() { TriviaGameQuestion question = new TriviaGameQuestion() { Question = this.Question, CorrectAnswer = this.CorrectAnswer }; foreach (string wrongAnswer in this.WrongAnswers) { if (!string.IsNullOrEmpty(wrongAnswer)) { question.WrongAnswers.Add(wrongAnswer); } } return(question); }