XText.Value Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the value of this node.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
The following example shows getting and setting this property.
StringBuilder output = new StringBuilder(); XElement root = new XElement("Root", "Some text"); XText txtNode = root.Nodes().OfType<XText>().First(); output.Append(txtNode.Value + Environment.NewLine); txtNode.Value = "New text"; output.Append(txtNode.Value + Environment.NewLine); root.Value = "Newer text"; txtNode = root.Nodes().OfType<XText>().First(); output.Append(txtNode.Value + Environment.NewLine); OutputTextBlock.Text = output.ToString();
Show: