XamlDirect.GetXamlDirectObject(Object) XamlDirect.GetXamlDirectObject(Object) XamlDirect.GetXamlDirectObject(Object) XamlDirect.GetXamlDirectObject(Object) Method

Definition

Gets the instance as an IXamlDirectObject for a given XAML type.

public : IXamlDirectObject GetXamlDirectObject(Platform::Object object)
IXamlDirectObject GetXamlDirectObject(winrt::Windows::Foundation::IInspectable object) const;
public IXamlDirectObject GetXamlDirectObject(Object object)
Public Function GetXamlDirectObject(object As Object) As IXamlDirectObject

Parameters

object
Object Object

Refers to the specific XAML type (typically, but not always, a DependencyObject ).

Returns

Examples

The following example shows how to get the IXamlDirectObject instance from a full XAML type.

XamlDirect xd = XamlDirect.GetDefault();

Border border = new Border();
IXamlDirectObject borderXDO = xd.GetXamlDirectObject(border);
XamlDirect^ xd = XamlDirect::GetDefault();

Border^ border = ref new Border();
IXamlDirectObject^ borderXDO = xd->GetXamlDirectObject(border);

Remarks

Use this method to convert from a full XAML type to its XamlDirect instance and then get the performance benefits of XamlDirect through property management, collection management and event handling functionalities exposed through the XamlDirect APIs.

See also