XamlReader.Parse 方法

定義

讀取指定之文字字串中的標記,並傳回與指定之標記的根相對應的物件。

多載

Parse(String, ParserContext)

讀取指定之文字字串中的 XAML 標記 (使用指定的 ParserContext),並傳回與指定之標記的根相對應的物件。

Parse(String)

讀取指定之文字字串中的 XAML 輸入,並傳回與指定之標記的根相對應的物件。

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

Parse(String, ParserContext)

讀取指定之文字字串中的 XAML 標記 (使用指定的 ParserContext),並傳回與指定之標記的根相對應的物件。

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

傳回

適用於