Share via


IXRVisualStateGroupCollection::Add (Compact 2013)

3/28/2014

This method adds an item to the end of the IXRVisualStateGroupCollection collection and retrieves the index that indicates where it was added.

Syntax

virtual HRESULT STDMETHODCALLTYPE Add(
    __in IXRVisualStateGroup* pObject,
    __out_opt int* pIndex
) = 0;

Parameters

  • pObject
    [in] Pointer to an IXRVisualStateGroup object that represents an item to add to this collection.
  • pIndex
    [out] Optional. Pointer to an integer value that indicates the zero-based index of the item added to this collection.

Return Value

Returns an HRESULT that indicates success or failure. Possible return values include the following.

Value

Description

S_OK

Success.

XR_E_COLLECTION_ELEMENT_ALREADY_ASSOCIATED

You attempted to add an item that already exists.

Remarks

Because an object cannot exist more than once in a visual tree, an item can occur only once in this object collection.

.NET Framework Equivalent

System.Windows.PresentationFrameworkCollection(T).Add

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRVisualStateGroupCollection