IXamlDirect.GetXamlDirectObjectFromCollectionAt(Object, UInt32) Metodo

Definizione

Restituisce l'elemento IXamlDirect in corrispondenza dell'indice specificato dall'insieme IXamlDirect specificato.

Questa documentazione si applica a WinUI 2 per la piattaforma UWP (per WinUI nel SDK per app di Windows, vedi gli spazi dei nomi SDK per app di Windows).

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

Parametri

xamlDirectObject
Object

Platform::Object

IInspectable

Fa riferimento all'insieme IXamlDirect specifico.

index
UInt32

unsigned int

uint32_t

Fa riferimento all'indice nella raccolta dell'elemento da ottenere.

Restituisce

Object

Platform::Object

IInspectable

Restituisce l'elemento IXamlDirect in corrispondenza dell'indice specificato dell'insieme.

Esempio

Nell'esempio seguente viene illustrato come accedere a un elemento IXamlDirect in corrispondenza dell'indice specificato di una raccolta.

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

Si applica a