XamlReader.Parse Method

Definition

Reads the markup in the specified text string and returns an object that corresponds to the root of the specified markup.

Overloads

Parse(String, ParserContext)

Reads the XAML markup in the specified text string (using a specified ParserContext) and returns an object that corresponds to the root of the specified markup.

Parse(String)

Reads the XAML input in the specified text string and returns an object that corresponds to the root of the specified markup.

Parse(String, Boolean)
Parse(String, ParserContext, Boolean)

Parse(String, ParserContext)

Reads the XAML markup in the specified text string (using a specified ParserContext) and returns an object that corresponds to the root of the specified markup.

C#
public static object Parse(string xamlText, System.Windows.Markup.ParserContext parserContext);

Parameters

xamlText
String

The input XAML, as a single text string.

parserContext
ParserContext

Context information used by the parser.

Returns

The root of the created object tree.

Remarks

The implementation calls Load internally after creating a stream from the string. See Load for additional information such as possible exceptions.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Parse(String)

Reads the XAML input in the specified text string and returns an object that corresponds to the root of the specified markup.

C#
public static object Parse(string xamlText);

Parameters

xamlText
String

The input XAML, as a single text string.

Returns

The root of the created object tree.

Remarks

The implementation calls Load internally after creating a stream from the string. See Load for additional information such as possible exceptions.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Parse(String, Boolean)

C#
public static object Parse(string xamlText, bool useRestrictiveXamlReader);

Parameters

xamlText
String
useRestrictiveXamlReader
Boolean

Returns

Applies to

Windows Desktop 10 and other versions
Product Versions
Windows Desktop 5, 6, 7, 8, 9, 10

Parse(String, ParserContext, Boolean)

C#
public static object Parse(string xamlText, System.Windows.Markup.ParserContext parserContext, bool useRestrictiveXamlReader);

Parameters

xamlText
String
parserContext
ParserContext
useRestrictiveXamlReader
Boolean

Returns

Applies to

Windows Desktop 10 and other versions
Product Versions
Windows Desktop 5, 6, 7, 8, 9, 10