XamlDirect.GetCollectionCount(IXamlDirectObject) XamlDirect.GetCollectionCount(IXamlDirectObject) XamlDirect.GetCollectionCount(IXamlDirectObject) XamlDirect.GetCollectionCount(IXamlDirectObject) Method

Definition

Returns the count of items in the specified IXamlDirectObject collection.

public : unsigned int GetCollectionCount(IXamlDirectObject xamlDirectObject)
uint32_t GetCollectionCount(IXamlDirectObject xamlDirectObject) const;
public uint GetCollectionCount(IXamlDirectObject xamlDirectObject)
Public Function GetCollectionCount(xamlDirectObject As IXamlDirectObject) As uint

Parameters

xamlDirectObject
IXamlDirectObject IXamlDirectObject

Refers to the specific IXamlDirectObject collection.

Returns

uint uint

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