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
XmlReader, or a
XamlReader, and it returns the root of the corresponding live object graph, like the older
XamlReader.Load API. Internally,
XamlObjectWriter to do its work, as in Listing 21.1.
Parse returns the root of a live object graph, but it accepts XAML content as ...