Condividi tramite


XamlDirect.InsertIntoCollectionAt Metodo

Definizione

Inserisce un valore nell'insieme IXamlDirectObject specificato in corrispondenza dell'indice specificato.

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)

Parametri

xamlDirectObject
IXamlDirectObject

Fa riferimento all'insieme IXamlDirectObject specifico.

index
UInt32

unsigned int

uint32_t

Fa riferimento all'indice nella raccolta in cui deve essere inserito il valore specificato.

value
IXamlDirectObject

Fa riferimento al valore IXamlDirectObject da aggiungere alla raccolta.

Esempio

L'esempio seguente mostra come inserire un valore in una raccolta in un indice specifico usando le API XamlDirect .

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

Si applica a

Vedi anche