WriteXml Method
Collapse the table of content
Expand the table of content

IXmlSerializable.WriteXml Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Converts an object into its XML representation.

Namespace:  System.Xml.Serialization
Assembly:  System.Xml (in System.Xml.dll)

void WriteXml(
	XmlWriter writer
)

Parameters

writer
Type: System.Xml.XmlWriter
The XmlWriter stream to which the object is serialized.

The implementation you provide for this method should write out the XML representation of the object. Write sufficient information to the XmlWriter stream to allow the ReadXml method to reconstitute your object. For example, if your object state includes an array variable, be sure to write the length of the array, or use a parent element to contain the elements that describe the array values, so that you know how many values to read when the object is reconstituted.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft