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


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


IXamlDirectObject IXamlDirectObject

Refers to the specific IXamlDirectObject.


object object

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


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));


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