TreeView.ItemsSource Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets an object source used to generate the content of the TreeView.
public:
property Platform::Object ^ ItemsSource { Platform::Object ^ get(); void set(Platform::Object ^ value); };
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
IInspectable ItemsSource();
void ItemsSource(IInspectable value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
IInspectable ItemsSource();
void ItemsSource(IInspectable value);
public object ItemsSource { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
public object ItemsSource { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] set; }
var object = treeView.itemsSource;
treeView.itemsSource = object;
Public Property ItemsSource As Object
<TreeView ItemsSource="bindingDeclaration"/>
-or-
<TreeView ItemsSource="resourceReferenceToSource"/>
Property Value
The object that is used to generate the content of the TreeView. The default is null.
- Attributes
-
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute
Remarks
The ItemsSource property value must implement one of these interfaces:
C++ | .NET |
---|---|
IIterable<IInspectable> | IEnumerable<Object> |
IBindableIterable | IEnumerable |
The ItemsControl can provide better performance if the ItemsSource property value also implements a random-access list interface:
C++ | .NET |
---|---|
IVector<IInspectable> | IList<Object> |
IVectorView<IInspectable> | IReadOnlyCollection<Object> |
IBindableVector | IList |
IBindableVectorView | IList |
The ItemsControl can respond to changes if the ItemsSource property value also implements a change notification interface:
C++ | .NET |
---|---|
IObservableVector<IInspectable> | INotifyCollectionChanged |