Chapter 15. Using the Silverlight Data Framework

Silverlight implements much of the .NET data framework to allow developers a means of delivering data content that can be modified and displayed from a rich UI. Silverlight provides several methods to implement data from a wide variety of sources such as XML files and SQL databases. Silverlight also provides interfaces to consume and display data from those sources.

This chapter discusses how to use Silverlight XML libraries, data binding, DataGrid controls, and LINQ queries to access and implement data in your Silverlight applications.

Using XmlReader and XmlWriter

Silverlight provides a subset of the System.Xml .NET framework for reading and writing XML data. The ability to read and write XML data allows you to easily implement Silverlight applications that interface with services that send and receive data in XML form.

The XmlReader class and the XmlWriter classes allow you to parse, edit, and write XML data in the memory of your Silverlight applications. These classes are part of the System.Xml library provided with Silverlight.

Implementing XmlReader to parse XML data

The XmlReader class is similar to the XmlDocument class provided with the .NET framework. It provides an interface to read and parse XML data.

To implement XmlReader in your Silverlight applications, you need to create an instance of the XmlReader class that has access to the XML data. This is done by calling the XmlReader.Create() function and passing in the source of ...

Get Silverlight™ 2 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.