WPF:什么是数据绑定用于收集正确的基类? [英] WPF: What is the right base class for collections used in data binding?
本文介绍了WPF:什么是数据绑定用于收集正确的基类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我建设有强类型集合类的对象模型(例如 CustomerCollection
)。我想支持全双向的两个集合本身和所有的数据模型的集合中结合。
I am building an object model with strongly typed collection classes (e.g. CustomerCollection
). I want to support full two-way binding on both the collection itself and all of the data models in the collection.
有关好像实施 INotifyPropertyChanged的
模型是要连接模型的正确途径。但inferface /基类,我应该使用让WPF知道当我的收藏中的内容改变?
For the models it seems like implementing INotifyPropertyChanged
is the right way to wire up the models. But what inferface/base class should I use so that WPF knows when my collection's contents change?
推荐答案
的ObservableCollection< T>
- 专为WPF设计结合
ObservableCollection<T>
- designed specifically for WPF binding.
这篇关于WPF:什么是数据绑定用于收集正确的基类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文