XamlDirect.RemoveFromCollectionAt(IXamlDirectObject, UInt32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
嘗試從指定索引處的 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);