以下是一些 XAML 代码
<HierarchicalDataTemplate DataType="{x:Type data:FolderEntity}"
ItemsSource="{Binding Path=FolderEntities,UpdateSourceTrigger=PropertyChanged}">
<Label Content="{Binding FolderName}"/>
</HierarchicalDataTemplate>
<TreeView/>
data:FolderEntity是一个实现了INotifyPropertyChanging和INotifyPropertyChanged接口的LINQ to SQL数据类。
我的问题是,当我更改FolderEntities属性时,绑定不会更新。如果我更改FolderName属性,则对应该项的树节点将更改,但是FolderEntities集合就是不会。
我在想WPF是否会检查集合引用是否已更改,或者ItemsSource对象必须是ObservableCollection`1才能正常工作?
非常感谢任何关于此事的意见。