XmlAttributes.XmlText Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets an object that instructs the XmlSerializer to serialize a public field or public read/write property as XML text.
Assembly: System.Xml.Serialization (in System.Xml.Serialization.dll)
Property Value
Type: System.Xml.Serialization.XmlTextAttributeAn XmlTextAttribute that overrides the default serialization of a public property or field.
By default, a public field or public read/write property is serialized as an XML element by the XmlSerializer. However, it can force the field or property to be serialized as XML text by applying an XmlTextAttribute to the field or property.
Note: |
|---|
The XmlTextAttribute cannot be applied to a field or property that returns an array. |
To override the default serialization of a field or property (that does not return an array), create an XmlTextAttribute and assign it to the XmlText property of an XmlAttributes object. Add the XmlAttributes object to an XmlAttributeOverrides object and specify the type of the object that contains the overridden field or property and the name of the overridden field or property.
Note: