XamlDirect.GetObject(IXamlDirectObject) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets (and creates if necessary) the instance as its full XAML type of the specified IXamlDirectObject.
public:
virtual Platform::Object ^ GetObject(IXamlDirectObject ^ xamlDirectObject) = GetObject;
IInspectable GetObject(IXamlDirectObject const& xamlDirectObject);
public object GetObject(IXamlDirectObject xamlDirectObject);
function getObject(xamlDirectObject)
Public Function GetObject (xamlDirectObject As IXamlDirectObject) As Object
Parameters
- xamlDirectObject
- IXamlDirectObject
Refers to the specific IXamlDirectObject.
Returns
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.