IXamlDirect.RemoveFromCollectionAt(Object, UInt32) メソッド

定義

指定したインデックス位置にある IXamlDirect コレクションから値を削除しようとします。

このドキュメントは、WinUI 2 for UWP に適用されます (Windows アプリ SDKWinUI については、Windows アプリ SDK名前空間を参照してください)。

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)

パラメーター

xamlDirectObject
Object

Platform::Object

IInspectable

特定の IXamlDirect コレクションを参照します。

index
UInt32

unsigned int

uint32_t

値を削除する必要があるコレクション内のインデックスを参照します。

次の例は、 XamlDirect API を使用して特定のインデックスから値を削除する方法を示しています。

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

適用対象

こちらもご覧ください