Parses a well-formed XAML fragment and creates a corresponding Silverlight object tree, and returns the root of the object tree.
Assembly: System.Windows (in System.Windows.dll)
'Declaration Public Shared Function Load ( _ xaml As String _ ) As Object
public static Object Load( string xaml )
A string that contains a valid XAML fragment.
The root object of the Silverlight object tree.
Usage for Load is documented thoroughly in the topic Using XamlReader.Load.
A "well-formed XAML fragment" must meet the following requirements:
The XAML content string must define a single root element.
The content string XAML must be well formed XML, as well as being parseable XAML.
Note that these conditions report parsing exceptions but the message in the exception will specifically note the cause indicating a general format failure rather than a specific parsing failure against the vocabulary identified by the XML namespace.
Beyond being "well-formed", Load will also report failures that occur when the XAML is submitted to the parser. See "XAMLReader.Load and Parsing Behavior" section of Using XamlReader.Load.
Any objects with a Name or x:Name value in the input XAML will be considered to be within a discrete XAML namescope, once the returned object tree is added to the main object tree. This can influence your ability to find the object in scope with FindName. For details, see "XAML Namescope Considerations" section of Using XamlReader.Load.
Supported in: 5, 4, 3
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.