Skip to content

Latest commit

 

History

History
56 lines (33 loc) · 2.01 KB

ixamldirect_removefromcollectionat_1329285826.md

File metadata and controls

56 lines (33 loc) · 2.01 KB
-api-id -api-type
M:Microsoft.UI.Xaml.Core.Direct.IXamlDirect.RemoveFromCollectionAt(System.Object,System.UInt32)
winrt method

Microsoft.UI.Xaml.Core.Direct.IXamlDirect.RemoveFromCollectionAt(System.Object,System.UInt32)

-description

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

-parameters

-param xamlDirectObject

Refers to the specific IXamlDirect collection.

-param index

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

-remarks

-see-also

IXamlDirect.InsertIntoCollectionAt(System.Object,System.UInt32,System.Object), IXamlDirect.AddToCollection(System.Object,System.Object), IXamlDirect.RemoveFromCollection(System.Object,System.Object), IXamlDirect.ClearCollection(System.Object)

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