/// <summary> /// Initializes a new instance of the <see cref="ProcessViewViewModel"/> class. /// </summary> /// <param name="model">The model.</param> /// <param name="parentViewModel">The parent view model.</param> public ProcessViewViewModel(ProcessViewEdit model, ProcessViewsViewModel parentViewModel) { Parent = parentViewModel; Sections = new ObservableCollection<ProcessViewSectionViewModel>(); SetModel(model); }
/// <summary> /// Sets the model. /// </summary> /// <param name="model">The model.</param> public void SetModel(ProcessViewEdit model) { Model = model; Sections.Clear(); if (Model != null) { foreach (var section in Model.SectionList) { var sectionViewModel = new ProcessViewSectionViewModel(section, this); Sections.Add(sectionViewModel); } } }