Bagikan melalui


XamlDirect.GetCollectionCount(IXamlDirectObject) Metode

Definisi

Mengembalikan jumlah item dalam koleksi IXamlDirectObject yang ditentukan.

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

Parameter

xamlDirectObject
IXamlDirectObject

Mengacu pada koleksi IXamlDirectObject tertentu.

Mengembalikan

UInt32

unsigned int

uint32_t

Jumlah item.

Contoh

Contoh berikut menunjukkan cara mendapatkan hitungan Panel.Children melalui instans 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);

Berlaku untuk