//private static ElementViewModel FindRoot(ElementViewModel element) //{ // var currentElement = element; // while (currentElement.Parent != null) // { // currentElement = currentElement.Parent; // } // return currentElement; //} public void Populate() { foreach (var xmlAttribute in this.InternalElement.Attributes()) { var attribute = new AttributeViewModel(xmlAttribute, this); this.Attributes.Add(attribute); } foreach (var xmlElement in this.InternalElement.Elements()) { var element = new ElementViewModel(xmlElement, this); this.ChildElements.Add(element); //element.Populate(); } }
//private static ElementViewModel FindRoot(ElementViewModel element) //{ // var currentElement = element; // while (currentElement.Parent != null) // { // currentElement = currentElement.Parent; // } // return currentElement; //} public void Populate() { foreach (var xmlAttribute in this.InternalElement.Attributes()) { var attribute = new AttributeViewModel(xmlAttribute, this); this.Attributes.Add(attribute); } foreach (var xmlElement in this.InternalElement.Elements()) { var element = new ElementViewModel(xmlElement, this); this.ChildElements.Add(element); //element.Populate(); } }