XamlReader exposes a simple
Load method that accepts a string and returns a
System.Object. It parses the XAML in the string, creates the appropriate objects, and returns an instance of the root element.
If you have a string containing XAML content whose root element is a
Page object, the following C# code could be used to load and retrieve the root
string xamlString = ...;// Get the root element, which we know is a PagePage p = (Page)XamlReader .Load(xamlString);
Load returns, the entire hierarchy of objects in the XAML file is instantiated in memory, so the XAML itself is no longer needed. Now that an instance of the root element exists, you can retrieve child elements by making use ...