Inheritance: XmlNodeViewModel
Ejemplo n.º 1
0
        //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();
            }
        }
Ejemplo n.º 2
0
        //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();
              }
        }