XamlReader.Parse 方法

定义

读取指定文本字符串中的标记,并返回与指定标记的根对应的对象。

重载

名称 说明
Parse(String, ParserContext)

读取指定文本字符串(使用指定的 ParserContext)中的 XAML 标记,并返回与指定标记的根对应的对象。

Parse(String)

读取指定文本字符串中的 XAML 输入,并返回与指定标记的根对应的对象。

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

Parse(String, ParserContext)

读取指定文本字符串(使用指定的 ParserContext)中的 XAML 标记,并返回与指定标记的根对应的对象。

public:
 static System::Object ^ Parse(System::String ^ xamlText, System::Windows::Markup::ParserContext ^ parserContext);
public static object Parse(string xamlText, System.Windows.Markup.ParserContext parserContext);
static member Parse : string * System.Windows.Markup.ParserContext -> obj
Public Shared Function Parse (xamlText As String, parserContext As ParserContext) As Object

参数

xamlText
String

输入 XAML 作为单个文本字符串。

parserContext
ParserContext

分析器使用的上下文信息。

返回

所创建对象树的根。

注解

从字符串创建流后,实现在内部调用 Load 。 请参阅 Load 其他信息,例如可能的异常。

适用于

Parse(String)

读取指定文本字符串中的 XAML 输入,并返回与指定标记的根对应的对象。

public:
 static System::Object ^ Parse(System::String ^ xamlText);
public static object Parse(string xamlText);
static member Parse : string -> obj
Public Shared Function Parse (xamlText As String) As Object

参数

xamlText
String

输入 XAML 作为单个文本字符串。

返回

所创建对象树的根。

注解

从字符串创建流后,实现在内部调用 Load 。 请参阅 Load 其他信息,例如可能的异常。

适用于

Parse(String, Boolean)

public:
 static System::Object ^ Parse(System::String ^ xamlText, bool useRestrictiveXamlReader);
public static object Parse(string xamlText, bool useRestrictiveXamlReader);
static member Parse : string * bool -> obj
Public Shared Function Parse (xamlText As String, useRestrictiveXamlReader As Boolean) As Object

参数

xamlText
String
useRestrictiveXamlReader
Boolean

返回

适用于

Parse(String, ParserContext, Boolean)

public:
 static System::Object ^ Parse(System::String ^ xamlText, System::Windows::Markup::ParserContext ^ parserContext, bool useRestrictiveXamlReader);
public static object Parse(string xamlText, System.Windows.Markup.ParserContext parserContext, bool useRestrictiveXamlReader);
static member Parse : string * System.Windows.Markup.ParserContext * bool -> obj
Public Shared Function Parse (xamlText As String, parserContext As ParserContext, useRestrictiveXamlReader As Boolean) As Object

参数

xamlText
String
parserContext
ParserContext
useRestrictiveXamlReader
Boolean

返回

适用于