Condividi tramite


XamlDirect.GetCollectionCount(IXamlDirectObject) Metodo

Definizione

Restituisce il numero di elementi nell'insieme IXamlDirectObject specificato.

public:
 virtual unsigned int GetCollectionCount(IXamlDirectObject ^ xamlDirectObject) = GetCollectionCount;
uint32_t GetCollectionCount(IXamlDirectObject const& xamlDirectObject);
public uint GetCollectionCount(IXamlDirectObject xamlDirectObject);
function getCollectionCount(xamlDirectObject)
Public Function GetCollectionCount (xamlDirectObject As IXamlDirectObject) As UInteger

Parametri

xamlDirectObject
IXamlDirectObject

Si riferisce all'insieme IXamlDirectObject specifico.

Restituisce

UInt32

unsigned int

uint32_t

Numero di elementi.

Esempio

Nell'esempio seguente viene illustrato come ottenere il conteggio di Panel.Children tramite l'istanza di IXamlDirectObject.

XamlDirect xd = XamlDirect.GetDefault();

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

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

uint count = xd.GetCollectionCount(childrenCollection);
XamlDirect^ xd = XamlDirect::GetDefault();

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

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

UINT count = xd->GetCollectionCount(childrenCollection);

Si applica a