XamlServices
To minimize the amount of code you need to write, the most common uses for XAML readers and writers are packaged in a set of easy-to-use static methods in a class called System.Xaml.XamlServices
. It has the following methods:
Load—Depending on the overload, you can give it a filename string, a Stream
, a TextReader
, an XmlReader
, or a XamlReader
, and it returns the root of the corresponding live object graph, like the older XamlReader.Load
API. Internally, Load
uses XamlXmlReader
and XamlObjectWriter
to do its work, as in Listing 21.1.
Parse—Like Load
, Parse
returns the root of a live object graph, but it accepts XAML content as ...
Get XAML Unleashed 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.