TreeViewItem.ItemsSource プロパティ

定義

TreeView のコンテンツの生成に使用するオブジェクト ソースを取得または設定します。

このドキュメントは、WinUI 2 for UWP に適用されます (Windows アプリ SDKWinUI については、Windows アプリ SDK名前空間を参照してください)。

public:
 property Platform::Object ^ ItemsSource { Platform::Object ^ get(); void set(Platform::Object ^ value); };
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 { get; 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; }
Public Property ItemsSource As Object
<TreeViewItem ItemsSource="bindingDeclaration"/>
-or-
<TreeViewItem ItemsSource="resourceReferenceToSource"/>

プロパティ値

Object

Platform::Object

IInspectable

TreeViewItem のコンテンツを生成するために使用されるオブジェクト。 既定値は null です

属性
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute

注釈

ItemsSource プロパティの値は、次のいずれかのインターフェイスを実装する必要があります。

C++ .NET
IIterable<IInspectable> IEnumerable<オブジェクト>
IBindableIterable IEnumerable

ItemsSource プロパティ値にもランダム アクセス リスト インターフェイスが実装されている場合、ItemsControl はパフォーマンスを向上させることができます。

C++ .NET
IVector<IInspectable> IList<オブジェクト>
IVectorView<IInspectable> IReadOnlyCollection<オブジェクト>
IBindableVector IList
IBindableVectorView IList

ItemsSource プロパティ値にも変更通知インターフェイスが実装されている場合、ItemsControl は変更に応答できます。

C++ .NET
IObservableVector<IInspectable> INotifyCollectionChanged

適用対象