XamlDirect.GetCollectionCount(IXamlDirectObject) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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);