XmlSerializer Constructor (Type, XmlRootAttribute)
Initializes a new instance of the XmlSerializer class that can serialize objects of the specified type into XML documents and deserialize an XML document into object of the specified type. It also specifies the class to use as the XML root element.
Assembly: System.Xml.Serialization (in System.Xml.Serialization.dll)
'Declaration Public Sub New ( _ type As Type, _ root As XmlRootAttribute _ )
public XmlSerializer( Type type, XmlRootAttribute root )
The root element of an XML document encloses all the other elements. By default, the object specified by the type parameter is serialized as the root element. Properties, such as the XML element name of the root element, are taken from the type object. However, the root parameter allows you to replace the default object's information by specifying an XmlRootAttribute. The object allows you to set a different namespace, element name, and so on.
Supported in: 5, 4, 3
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
Supported in: Xbox 360, Windows Phone OS 7.0
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.