Dela via


TreeView.ItemsSource Property

Definition

Gets or sets an object source used to generate the content of the TreeView.

Equivalent WinUI 2 API for UWP: Microsoft.UI.Xaml.Controls.TreeView.ItemsSource (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

public:
 property Platform::Object ^ ItemsSource { Platform::Object ^ get(); void set(Platform::Object ^ value); };
IInspectable ItemsSource();

void ItemsSource(IInspectable value);
public object ItemsSource { get; set; }
var object = treeView.itemsSource;
treeView.itemsSource = object;
Public Property ItemsSource As Object
<TreeView ItemsSource="bindingDeclaration"/>
-or-
<TreeView ItemsSource="resourceReferenceToSource"/>

Property Value

Object

Platform::Object

IInspectable

The object that is used to generate the content of the TreeView. The default is null.

Windows requirements

Device family
Windows 10, version 1809 (introduced in 10.0.17763.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v7.0)

Remarks

The type of the object that you set the ItemsSource property to must implement particular interface(s). For more details, see the Remarks section of ItemsControl.ItemsSource.

Applies to