IXamlDirect.InsertIntoCollectionAt(Object, UInt32, Object) 메서드

정의

지정된 인덱스의 지정된 IXamlDirect 컬렉션에 값을 삽입합니다.

이 설명서는 UWP용 WinUI 2에 적용됩니다(Windows 앱 SDKWinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

public:
 void InsertIntoCollectionAt(Platform::Object ^ xamlDirectObject, unsigned int index, Platform::Object ^ value);
void InsertIntoCollectionAt(IInspectable const& xamlDirectObject, uint32_t const& index, IInspectable const& value);
public void InsertIntoCollectionAt(object xamlDirectObject, uint index, object value);
Public Sub InsertIntoCollectionAt (xamlDirectObject As Object, index As UInteger, value As Object)

매개 변수

xamlDirectObject
Object

Platform::Object

IInspectable

특정 IXamlDirect 컬렉션을 참조합니다.

index
UInt32

unsigned int

uint32_t

지정된 값을 삽입해야 하는 컬렉션의 인덱스를 참조합니다.

value
Object

Platform::Object

IInspectable

컬렉션에 추가할 IXamlDirect 값을 참조합니다.

예제

다음 예제에서는 XamlDirect API를 사용하여 특정 인덱스의 컬렉션에 값을 삽입하는 방법을 보여 줍니다.

XamlDirect xd = XamlDirect.GetDefault();

IXamlDirect relativePanel = xd.CreateInstance(XamlTypeIndex.RelativePanel);

IXamlDirect childrenCollection = xd.GetXamlDirectObjectProperty(relativePanel, XamlPropertyIndex.Panel_Children);

IXamlDirect button = xd.CreateInstance(XamlTypeIndex.Button);
xd.InsertIntoCollectionAt(childrenCollection, 0, button);
XamlDirect^ xd = XamlDirect::GetDefault();

IXamlDirect^ relativePanel = xd->CreateInstance(XamlTypeIndex::RelativePanel);

IXamlDirect^ childrenCollection = xd->GetXamlDirectObjectProperty(relativePanel, XamlPropertyIndex::Panel_Children);

IXamlDirect^ button = xd->CreateInstance(XamlTypeIndex::Button);
xd->InsertIntoCollectionAt(childrenCollection, 0, button);

적용 대상

추가 정보