XamlDirect.GetXamlDirectObjectFromCollectionAt 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從指定的 IXamlDirectObject 集合傳回位於指定索引處的 IXamlDirectObject 專案。
public:
virtual IXamlDirectObject ^ GetXamlDirectObjectFromCollectionAt(IXamlDirectObject ^ xamlDirectObject, unsigned int index) = GetXamlDirectObjectFromCollectionAt;
IXamlDirectObject GetXamlDirectObjectFromCollectionAt(IXamlDirectObject const& xamlDirectObject, uint32_t const& index);
public IXamlDirectObject GetXamlDirectObjectFromCollectionAt(IXamlDirectObject xamlDirectObject, uint index);
function getXamlDirectObjectFromCollectionAt(xamlDirectObject, index)
Public Function GetXamlDirectObjectFromCollectionAt (xamlDirectObject As IXamlDirectObject, index As UInteger) As IXamlDirectObject
參數
- xamlDirectObject
- IXamlDirectObject
參考特定的 IXamlDirectObject 集合。
- index
-
UInt32
unsigned int
uint32_t
參考要取得之專案集合中的索引。
傳回
傳回集合指定索引處的 IXamlDirectObject 專案。
範例
下列範例示範如何在集合的指定索引處存取 IXamlDirectObject 專案。
XamlDirect xd = XamlDirect.GetDefault();
IXamlDirectObject relativePanel = xd.CreateInstance(XamlTypeIndex.RelativePanel);
IXamlDirectObject childrenCollection = xd.GetXamlDirectObjectProperty(relativePanel, XamlPropertyIndex.Panel_Children);
IXamlDirectObject first = xd.GetXamlDirectObjectFromCollectionAt(childrenCollection, 0);
XamlDirect^ xd = XamlDirect::GetDefault();
IXamlDirectObject^ relativePanel = xd->CreateInstance(XamlTypeIndex::RelativePanel);
IXamlDirectObject^ childrenCollection = xd->GetXamlDirectObjectProperty(relativePanel, XamlPropertyIndex::Panel_Children);
IXamlDirectObject^ first = xd->GetXamlDirectObjectFromCollectionAt(childrenCollection, 0);