WPF : 对Collection要注意重用子控件

一般的,

ListBox.ItemSource <==> ObservableCollection<User>

如果经常更新数据源的话, 会引起子控件不断的创建和销毁, 从而引起性能问题.

一个办法是:

ListBox.ItemSource <==> ObservableCollection<UserProxy> <==> ObservableCollection<User>

通过UserProxy是否有真实值来决定是否显示子控件(子控件不销毁)

原文地址:https://www.cnblogs.com/mrfangzheng/p/1609549.html