XamlDirect.GetObject(IXamlDirectObject) XamlDirect.GetObject(IXamlDirectObject) XamlDirect.GetObject(IXamlDirectObject) XamlDirect.GetObject(IXamlDirectObject) Method

Definition

Gets (and creates if necessary) the instance as its full XAML type of the specified IXamlDirectObject.

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

Parameters

xamlDirectObject
IXamlDirectObject IXamlDirectObject

Refers to the specific IXamlDirectObject.

Returns

object object

Returns the instance of the full XAML type (typically, but not always, a DependencyObject ).

Examples

The following example shows how to convert an IXamlDirectObject instance pointing to a Border element to its full XAML type.

XamlDirect xd = XamlDirect.GetDefault();

IXamlDirectObject border = xd.CreateInstance(XamlTypeIndex.Border);
Border borderDO = (Border)xd.GetObject(border);
XamlDirect^ xd = XamlDirect::GetDefault();

IXamlDirectObject^ border = xd->CreateInstance(XamlTypeIndex::Border);
Border^ borderDO = dynamic_cast<Border^>(xd->GetObject(border));

Remarks

Use this method to convert from a XamlDirect instance to its full XAML type. This results in the creation of a full object and hence the performance benefits of staying within the XamlDirect APIs will be lost for that specific IXamlDirectObject instance.

See also