Share via


XamlDirect.GetXamlDirectObject(Object) Method

Definition

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

public:
 virtual IXamlDirectObject ^ GetXamlDirectObject(Platform::Object ^ object) = GetXamlDirectObject;
IXamlDirectObject GetXamlDirectObject(IInspectable const& object);
public IXamlDirectObject GetXamlDirectObject(object object);
function getXamlDirectObject(object)
Public Function GetXamlDirectObject (object As Object) As IXamlDirectObject

Parameters

object
Object

Platform::Object

IInspectable

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

Returns

Returns the IXamlDirectObject instance.

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.

Applies to

See also