다음을 통해 공유


IXamlDirect.ClearCollection(Object) 메서드

정의

지정된 IXamlDirect 컬렉션에서 모든 항목을 제거합니다.

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

public:
 void ClearCollection(Platform::Object ^ xamlDirectObject);
void ClearCollection(IInspectable const& xamlDirectObject);
public void ClearCollection(object xamlDirectObject);
Public Sub ClearCollection (xamlDirectObject As Object)

매개 변수

xamlDirectObject
Object

Platform::Object

IInspectable

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

예제

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.AddToCollection(childrenCollection, button);

xd.ClearCollection(childrenCollection);
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->AddToCollection(childrenCollection, button);

xd->ClearCollection(childrenCollection);

적용 대상

추가 정보