private void AddQuestionTypeParam_Executed(object arg) { var param = new QuestionTypeParamViewModel(); param.RemoveQuestionTypeParam.CanBeExecuted = AddQuestionTypeParam.CanBeExecuted; Params.Add(param); }
public void AddParam(string name, string value) { var param = new QuestionTypeParamViewModel(new QuestionTypeParam { Name = name, Value = value }); param.RemoveQuestionTypeParam.CanBeExecuted = AddQuestionTypeParam.CanBeExecuted; Params.Add(param); }
public QuestionTypeViewModel(QuestionType model) { Model = model; Params = new ObservableCollection <QuestionTypeParamViewModel>(); Model.PropertyChanged += Model_PropertyChanged; AddQuestionTypeParam = new SimpleCommand(AddQuestionTypeParam_Executed) { CanBeExecuted = AddQuestionTypeParam_CanExecute() }; foreach (var item in Model.Params) { var viewModel = new QuestionTypeParamViewModel(item) { Owner = this }; viewModel.RemoveQuestionTypeParam.CanBeExecuted = AddQuestionTypeParam.CanBeExecuted; Params.Add(viewModel); } Params.CollectionChanged += Params_CollectionChanged; }