Compartilhar via


XamlDirect.GetCollectionCount(IXamlDirectObject) Método

Definição

Retorna a contagem de itens na coleção IXamlDirectObject especificada.

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

Parâmetros

xamlDirectObject
IXamlDirectObject

Refere-se à coleção específica IXamlDirectObject .

Retornos

UInt32

unsigned int

uint32_t

Contagem de itens.

Exemplos

O exemplo a seguir mostra como obter a contagem de Panel.Children por meio da instância do 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);

Aplica-se a