[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Returns an element that is created by parsing the provided XAML, and sets that element to be the child of this control.
Namespace:
System.Windows.Controls Assembly:
System.Windows (in System.Windows.dll)
Visual Basic (Declaration)
Protected Function InitializeFromXaml ( _
xaml As String _
) As FrameworkElement
Dim xaml As String
Dim returnValue As FrameworkElement
returnValue = Me.InitializeFromXaml(xaml)
protected FrameworkElement InitializeFromXaml(
string xaml
)
protected:
FrameworkElement^ InitializeFromXaml(
String^ xaml
)
protected function InitializeFromXaml(
xaml : String
) : FrameworkElement
You would typically use the return value of InitializeFromXaml to retain an instance value on which you would set any instance properties that the control class defines.
Although the xaml parameter type is String, you would seldom want to provide a literal string to fill this value. Instead, you might obtain this XAML content by loading a resource, either a Silverlight-specific resource, or a resource in the sense of an assembly part if you are defining a control's code and its visual appearance as component parts of an assembly. You might use other types such as Stream or StreamReader as intermediaries to load assembly resources.
If the root of the XAML parsing is not a FrameworkElement or subclass, InitializeFromXaml will throw an exception.
Reference