Skip to content

DataContractSerialization

Rico Suter edited this page Jul 8, 2015 · 5 revisions
  • Package: MyToolkit.Extended
  • Platforms: WP7SL, WP8SL, WinRT, UWP

Provides methods to serialize and deserialize an object using the DataContract serializer.

var person = new Person();

...

var xml = DataContractSerialization.Serialize(person);
var personCopy = DataContractSerialization.Deserialize<Person>(xml);

Note: Use the DataContract and DataMember attributes from the .NET BCL to control the serialization process.

Additional methods:

  • SerializeAsync()
  • DeserializeAsync()

See also XmlSerialization

Clone this wiki locally