public SomeHierarchyViewModel(string title, List <SomeHierarchyViewModel> children, SomeHierarchyViewModel parent = null) { this.Title = title; this.Parent = parent; this.Children = children; if (this.Children != null) { this.Children.ForEach(ch => ch.Parent = this); } }
public SomeHierarchyViewModel(string title, List<SomeHierarchyViewModel> children, SomeHierarchyViewModel parent = null) { this.Title = title; this.Parent = parent; this.Children = children; if (this.Children != null) { this.Children.ForEach(ch => ch.Parent = this); } }