XAttribute.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 attribute.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
| Exception | Condition |
|---|---|
| ArgumentNullException | When setting, the value is Nothing. |
You can use this property to get or set the value of an attribute.
Setting this property will raise the Changed and the Changing events.
If you are getting the value and the attribute might not exist, it is more convenient to use the explicit conversion operators, and assign the attribute to a nullable type such as string or Nullable(Of T) of Int32. If the attribute does not exist, then the nullable type is set to Nothing. Before using this property, you must make sure that the Attribute method does not return Nothing.