WPF:数据绑定中使用的集合的正确基类是什么?

编程入门 行业动态 更新时间:2024-10-10 21:33:11
本文介绍了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:数据绑定中使用的集合的正确基类是什么?

本文发布于:2023-11-27 22:40:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639896.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:绑定   正确   数据   WPF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!