ObservableCollection 教程? [英] ObservableCollection tutorial?

查看:23
本文介绍了ObservableCollection 教程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能指导我一些简单的图形化教程,了解如何使用 ObservableCollection.我浏览了 msdn,但我似乎不理解它们.我似乎也无法在谷歌上找到更好的.我正在寻找对所有步骤进行完整解释的简单示例.

Will anyone direct me to some simple, graphical tutorial on how to use ObservableCollection. I went through msdn but I don't seem to understand them. I can't seem to find better ones on google either. I'm looking for simple example with full explanation on all steps.

推荐答案

我不知道 ObservableCollection 的任何图形教程.ObservableCollection 类是一个集合类型(如 List),这意味着它保存给定类型 T 的对象.ObservableCollection 特别 是它告诉"观察者何时添加新对象或何时删除对象.这对于使用 WPF 实现的 UI 尤其有用,因为本质上,当一个对象添加到可观察集合中或从可观察集合中删除时,UI 会自动更新.发生这种情况是因为,当绑定到可观察集合时,WPF 会自动将事件处理程序添加到 ObservableCollecionCollectionChanged 事件.

I don't know of any graphical tutorial of ObservableCollection. The ObservableCollection<T> class is a collection type (like List<T>) which means that it holds objects of a given type T. What makes ObservableCollection special is that it "tells" observers when a new object is added or when an object is removed. This is especially useful for UI's implemented using WPF, because esentially, when an object is added to or removed from an observable collection, the UI is automatically updated. This happens because, when binding to an observable collection, WPF automatically adds an event handler to the ObservableCollecion's CollectionChanged event.

这篇关于ObservableCollection 教程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆