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进来,不需要显示的数据删掉)
怎样改善,就是看文章吧,我现在也是在学习中
下面的连接, 讲了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进来,不需要显示的数据删掉)
怎样改善,就是看文章吧,我现在也是在学习中
本文探讨了TreeView控件在处理大量数据时出现的性能问题,并提出了三种改进策略:1. 清理收缩后的UI元素内存;2. 实现UI虚拟化;3. 实施数据虚拟化。这些方法有助于提高TreeView在复杂应用中的响应速度。
2300





