// Model,Viewと接続 public void ConnectMV(QuestionModel questionModel, EditModeQuestionItemView questionItemView) { QuestionModel = questionModel; EditModeQuestionItemView = questionItemView; //EditModeQuestionItemView.SetViewModel(this); }
// インスタンス作成 Model,Viewと接続 public static _EditModeQuestionItemViewModel CreateInstance( QuestionModel questionModel, EditModeQuestionItemView questionItemView, UserControl root) { var instance = new _EditModeQuestionItemViewModel(); instance.ConnectMV(questionModel, questionItemView); var answerModel = new AnswerModel(); instance.EditModeAnswerViewModel = EditModeAnswerViewModel.CreateInstance( MainWindow.EditModePanel.InterFacePanel.editModeAnswerView1); instance.Root = root; return instance; }