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

C#
public object GetXamlDirectObjectFromCollectionAt(object xamlDirectObject, uint index);

Parametri

xamlDirectObject
Object

Fa riferimento all'insieme IXamlDirect specifico.

index
UInt32

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

Restituisce

Object

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.

C#
XamlDirect xd = XamlDirect.GetDefault();

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

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

IXamlDirect first = xd.GetXamlDirectObjectFromCollectionAt(childrenCollection, 0);
CPP
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

Prodotto Versioni
WinUI 2 2.0, 2.1, 2.2, 2.3, 2.4, 2.5-prerelease, 2.5, 2.6-prerelease, 2.6, 2.7-prerelease, 2.7, 2.8-prerelease, 2.8