XamlDirect.RemoveFromCollectionAt(IXamlDirectObject, UInt32) 方法

定义

尝试从指定索引处的 IXamlDirectObject 集合中删除值。

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)

参数

xamlDirectObject
IXamlDirectObject

引用特定的 IXamlDirectObject 集合。

index
UInt32

unsigned int

uint32_t

引用集合中必须删除值的索引。

示例

以下示例演示如何使用 XamlDirect API 从特定索引中删除值。

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

适用于

另请参阅