一般的,
ListBox.ItemSource <==> ObservableCollection<User>
如果经常更新数据源的话, 会引起子控件不断的创建和销毁, 从而引起性能问题.
一个办法是:
ListBox.ItemSource <==> ObservableCollection<UserProxy> <==> ObservableCollection<User>
通过UserProxy是否有真实值来决定是否显示子控件(子控件不销毁)
Powered by: 博客园 Copyright © 2024 mrfangzheng Powered by .NET 8.0 on Kubernetes