Share via


IXamlDirect.GetXamlDirectObjectFromCollectionAt(Object, UInt32) Method

Definition

Overloads

GetXamlDirectObjectFromCollectionAt(Object, UInt32)

Returns the IXamlDirect item at the specified index from the specified IXamlDirect collection.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

GetXamlDirectObjectFromCollectionAt(Object, UInt32)

Returns the IXamlDirect item at the specified index from the specified IXamlDirect collection.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

public:
 Platform::Object ^ GetXamlDirectObjectFromCollectionAt(Platform::Object ^ xamlDirectObject, unsigned int index);
IInspectable GetXamlDirectObjectFromCollectionAt(IInspectable const& xamlDirectObject, uint32_t const& index);
public object GetXamlDirectObjectFromCollectionAt(object xamlDirectObject, uint index);
Public Function GetXamlDirectObjectFromCollectionAt (xamlDirectObject As Object, index As UInteger) As Object

Parameters

xamlDirectObject
Object

Platform::Object

IInspectable

Refers to the specific IXamlDirect collection.

index
UInt32

unsigned int

uint32_t

Refers to the index in the collection of the item to get.

Returns

Object

Platform::Object

IInspectable

Returns the IXamlDirect item at the specified index of the collection.

Examples

The following example shows how to access an IXamlDirect item at the specified index of a collection.

XamlDirect xd = XamlDirect.GetDefault();

IXamlDirect relativePanel = xd.CreateInstance(XamlTypeIndex.RelativePanel);

IXamlDirect childrenCollection = xd.GetXamlDirectObjectProperty(relativePanel, XamlPropertyIndex.Panel_Children);

IXamlDirect first = xd.GetXamlDirectObjectFromCollectionAt(childrenCollection, 0);
XamlDirect^ xd = XamlDirect::GetDefault();

IXamlDirect^ relativePanel = xd->CreateInstance(XamlTypeIndex::RelativePanel);

IXamlDirect^ childrenCollection = xd->GetXamlDirectObjectProperty(relativePanel, XamlPropertyIndex::Panel_Children);

IXamlDirect^ first = xd->GetXamlDirectObjectFromCollectionAt(childrenCollection, 0);

Applies to