XamlDirect.InsertIntoCollectionAt 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.
Inserts a value into the specified IXamlDirectObject collection at the specified index.
public:
virtual void InsertIntoCollectionAt(IXamlDirectObject ^ xamlDirectObject, unsigned int index, IXamlDirectObject ^ value) = InsertIntoCollectionAt;
void InsertIntoCollectionAt(IXamlDirectObject const& xamlDirectObject, uint32_t const& index, IXamlDirectObject const& value);
public void InsertIntoCollectionAt(IXamlDirectObject xamlDirectObject, uint index, IXamlDirectObject value);
function insertIntoCollectionAt(xamlDirectObject, index, value)
Public Sub InsertIntoCollectionAt (xamlDirectObject As IXamlDirectObject, index As UInteger, value As IXamlDirectObject)
Parameters
- xamlDirectObject
- IXamlDirectObject
Refers to the specific IXamlDirectObject collection.
- index
-
UInt32
unsigned int
uint32_t
Refers to the index in the collection where the specified value must be inserted.
- value
- IXamlDirectObject
Refers to the IXamlDirectObject value to add to the collection.
Examples
The following example shows how to insert a value into a collection at a specific index using XamlDirect APIs.
XamlDirect xd = XamlDirect.GetDefault();
IXamlDirectObject relativePanel = xd.CreateInstance(XamlTypeIndex.RelativePanel);
IXamlDirectObject childrenCollection = xd.GetXamlDirectObjectProperty(relativePanel, XamlPropertyIndex.Panel_Children);
IXamlDirectObject button = xd.CreateInstance(XamlTypeIndex.Button);
xd.InsertIntoCollectionAt(childrenCollection, 0, button);
XamlDirect^ xd = XamlDirect::GetDefault();
IXamlDirectObject^ relativePanel = xd->CreateInstance(XamlTypeIndex::RelativePanel);
IXamlDirectObject^ childrenCollection = xd->GetXamlDirectObjectProperty(relativePanel, XamlPropertyIndex::Panel_Children);
IXamlDirectObject^ button = xd->CreateInstance(XamlTypeIndex::Button);
xd->InsertIntoCollectionAt(childrenCollection, 0, button);