Share via


XamlDirect.GetCollectionCount(IXamlDirectObject) Method

Definition

Returns the count of items in the specified IXamlDirectObject collection.

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

Parameters

xamlDirectObject
IXamlDirectObject

Refers to the specific IXamlDirectObject collection.

Returns

UInt32

unsigned int

uint32_t

Count of items.

Examples

The following example shows how to get the count of Panel.Children through the IXamlDirectObject's instance.

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

Applies to