本文介绍了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 是连接模型的正确方法。但是我应该使用什么推论/基类,以便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:数据绑定中使用的集合的正确基类是什么?
发布评论