public void AddNewItem(Point pos, QuestionModel qItemModel) { var qItemViewModel = EditPointQuestionItemViewModel.CreateInstance(this.Parent); var relativePoint = qItemViewModel.ConvertAbsoluteToRelativePoint(pos); AddNewItem(qItemViewModel, relativePoint); qItemViewModel.Replace(); }
// Model,Viewと接続 public void ConnectMV(QuestionModel questionModel, EditModeQuestionItemView questionItemView) { QuestionModel = questionModel; EditModeQuestionItemView = questionItemView; //EditModeQuestionItemView.SetViewModel(this); }
public void AddQuestionItem(Point absolutePos) { var qItemModel = new QuestionModel(); ProblemModel.QuestionList.Add(qItemModel); EditModeMapAreaInnerViewModel.AddNewItem(absolutePos, qItemModel); EditModeQuestionListViewModel.ReloadModel(); }
public static QuizModeQuestionItemViewModel CreateInstance( QuizModeQuestionItemView view, QuestionModel model) { var instance = new QuizModeQuestionItemViewModel(); instance.QuizModeQuestionItemView = view; instance.QuestionModel = model; view.SetViewModel(instance); return instance; }
// インスタンス作成 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; }
public void AddNewItem(QuestionModel qItemModel) { var qItemViewModel = EditPointQuestionItemViewModel.CreateInstance(this.Parent); var relativePoint = qItemModel.Position; AddNewItem(qItemViewModel, relativePoint); }
public ProblemModel ConvertToExecutionModel() { var result = new ProblemModel(); result.MapImageRelativePath = MapImageFileRelativePath; result.QuestionList = new List<QuestionModel>(); foreach (var questionItem in Questions) { var newQuestion = new QuestionModel(); newQuestion.Position = questionItem.Position; newQuestion.Answer = new AnswerModel(); newQuestion.Answer.Items = new List<AnswerModel.Item>(); foreach (var answerItem in questionItem.Answers) { newQuestion.Answer.Items.Add(new AnswerModel.Item(answerItem)); } result.QuestionList.Add(newQuestion); } return result; }