WPF 中Treeview 的性能问题

来源:互联网 发布:js判断是否为function 编辑:程序博客网 时间:2024/04/30 17:07
Treeview 性能实在太差了. 我需要在每个item前面加上一个图标, 图标是从系统里面的来得, 但是当数据量一大, 就不行了. 不知道怎么回事, 当我有个com 对象调用后(com 对象会执行一个线程) , CPU占有率就持续100%. 不知道怎么回事.撤远了.
下面的连接, 讲了Treeview的优化,三篇文章, 应该有所帮助. (这里是Treeview分类的页面,包括下面三篇文章)
Are there any tricks that will help me improve TreeView’s performance? - Part I
Are there any tricks that will help me improve TreeView’s performance? - Part II
Are there any tricks that will help me improve TreeView’s performance? - Part III

性能问题主要在于
1 UI elements stay in memory after collapsed.
2 There is no UI virtualization. (
ListBox 和 ListView 有的,就是只对当前窗口需要显示的内容创建UI containers, 不显示的话,不显示了呢,就把这个dispose掉。 大概可以参考 VirtualizingStackPanel )
3 There is no data virtualization. (没有WPF控件支持,就是把需要当前窗口显示的数据load进来,不需要显示的数据删掉)


怎样改善,就是看文章吧,我现在也是在学习中
原创粉丝点击