IXamlDirect.RemoveFromCollectionAt(Object, UInt32) Method

Definition

Attempts to remove a value from the IXamlDirect collection at the specified index.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

public:
 void RemoveFromCollectionAt(Platform::Object ^ xamlDirectObject, unsigned int index);
void RemoveFromCollectionAt(IInspectable const& xamlDirectObject, uint32_t const& index);
public void RemoveFromCollectionAt(object xamlDirectObject, uint index);
Public Sub RemoveFromCollectionAt (xamlDirectObject As Object, index As UInteger)

Parameters

xamlDirectObject
Object

Platform::Object

IInspectable

Refers to the specific IXamlDirect collection.

index
UInt32

unsigned int

uint32_t

Refers to the index in the collection where the value must be removed.

Examples

The following example shows how to remove a value from a specific index using XamlDirect APIs.

XamlDirect xd = XamlDirect.GetDefault();

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

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

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

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

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

xd->RemoveFromCollectionAt(childrenCollection, 0);

Applies to

See also