WPF - Bound treeview not updating root items

后端 未结 2 1901
没有蜡笔的小新
没有蜡笔的小新 2021-01-24 10:31

I\'m using a WPF TreeView control, which I\'ve bound to a simple tree structure based on ObservableCollections. Here\'s the XAML:




        
2条回答
  •  感情败类
    2021-01-24 11:16

    if 'root' is an ObservableCollection your treeview will update. is 'root' an observable collection, or is root a node that is in an observable collection? seeing your binding for the items source would help to answer this question. as you are assigning it in code you might just be setting it to be a single element, not a collection

提交回复
热议问题