public XExamTypeVM(XExamType exType) { if (exType == null) throw new ArgumentNullException("Ссылка на объект XExamType не может быть null"); _exType = exType; _paramTypeObsCollection = new ObservableCollection<XParamTypeVM>(); if (exType.ParamsCollection == null) exType.ParamsCollection = new Collection<XParamType>(); foreach (var v in exType.ParamsCollection) _paramTypeObsCollection.Add(new XParamTypeVM(v)); _paramTypeObsCollection.CollectionChanged += ParamTypeObsCollection_CollectionChanged; _paramTypesCVS = new CollectionViewSource(); _paramTypesCVS.Source = _paramTypeObsCollection; }
public XExam() { ParamsCollection = new Collection<XParam>(); ExamType = new XExamType(); }