public RemoveQuestion(QuestionViewModel question) { if (question == null) throw new ArgumentNullException("question"); _question = question; }
private void NewQuestion() { NotifyIsDirty(); var vm = new QuestionViewModel( new Domain.Question(), _questionValidator, _answerValidator, _subjectValidator, _subjectQuery, _busId ); AddQuestion(vm); _view.MoveCurrentTo(vm); }
private void RemoveQuestion(QuestionViewModel question) { NotifyIsDirty(); DettachEvents(question); _questions.Remove(question); RaiseQuestionRemoved(question.Question); }
private bool CanRemoveQuestion(QuestionViewModel question) { return (question != null && _questions.Contains(question)); }
private void DettachEvents(QuestionViewModel question) { question.IsDirtyChangedEvent -= QuestionIsDirtyHandler; question.PropertyChanged -= QuestionChangedHandler; }
private void AddQuestion(QuestionViewModel question) { AttachEvents(question); this._questions.Add(question); RaiseQuestionAdded(question.Question); }