Bagikan melalui


XamlDirect.RemoveFromCollectionAt(IXamlDirectObject, UInt32) Metode

Definisi

Mencoba menghapus nilai dari koleksi IXamlDirectObject pada indeks yang ditentukan.

public:
 virtual void RemoveFromCollectionAt(IXamlDirectObject ^ xamlDirectObject, unsigned int index) = RemoveFromCollectionAt;
void RemoveFromCollectionAt(IXamlDirectObject const& xamlDirectObject, uint32_t const& index);
public void RemoveFromCollectionAt(IXamlDirectObject xamlDirectObject, uint index);
function removeFromCollectionAt(xamlDirectObject, index)
Public Sub RemoveFromCollectionAt (xamlDirectObject As IXamlDirectObject, index As UInteger)

Parameter

xamlDirectObject
IXamlDirectObject

Mengacu pada koleksi IXamlDirectObject tertentu.

index
UInt32

unsigned int

uint32_t

Mengacu pada indeks dalam koleksi tempat nilai harus dihapus.

Contoh

Contoh berikut menunjukkan cara menghapus nilai dari indeks tertentu menggunakan API XamlDirect .

XamlDirect xd = XamlDirect.GetDefault();

IXamlDirectObject relativePanel = xd.CreateInstance(XamlTypeIndex.RelativePanel);

IXamlDirectObject childrenCollection = xd.GetXamlDirectObjectProperty(relativePanel, XamlPropertyIndex.Panel_Children);

xd.RemoveFromCollectionAt(childrenCollection, 0);
XamlDirect^ xd = XamlDirect::GetDefault();

IXamlDirectObject^ relativePanel = xd->CreateInstance(XamlTypeIndex::RelativePanel);

IXamlDirectObject^ childrenCollection = xd->GetXamlDirectObjectProperty(relativePanel, XamlPropertyIndex::Panel_Children);

xd->RemoveFromCollectionAt(childrenCollection, 0);

Berlaku untuk

Lihat juga