XObject.Parent Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
The following example uses this method.
Dim output As New StringBuilder Dim doc As XDocument = _ <?xml version="1.0"?> <!--A comment in the document.--> <Root> <Child>content</Child> </Root> Dim child As XElement = doc.Descendants("Child").First() Dim root As XElement = child.Parent output.Append(root.Name) output.Append(Environment.NewLine) OutputTextBlock.Text = output.ToString()
Show:
Note: