public RootViewModel(List <Procedure> proceduresList) : base(null) { List <ProcedureViewModel> childrenProcs = new List <ProcedureViewModel>(); foreach (Procedure p in proceduresList) { ProcedureViewModel procViewModel = new ProcedureViewModel(this, p); childrenProcs.Add(procViewModel); base.Children.Add(procViewModel); } procedures = new ObservableCollection <ProcedureViewModel>(childrenProcs); }
// For procedures that are a child of Procedure public ProcedureViewModel(ProcedureViewModel parent, Procedure procedure) : base(parent) { this.procedure = procedure; }