WPF VirtualizingStackPanel for increased performance

馋奶兔 提交于 2019-11-27 03:18:26
Mike Two

There are two techniques that might be a big help. Both of them are described very well by Bea Stolnitz on her blog.

The first is UI Virtualization and the second is Data Virtualization

In UI virtualization you use things like VirtualizingStackPanel to make the UI draw fewer things.

Data virtualization makes sure you don't bring a million objects into memory when you are only going to show 100.

So UI virtualization minimizes the number of things drawn and data virtualization minimizes the number of things that could be drawn.

Hope that helps

user227789

I had exact the same problem ind WPF using TabControl and DataGrid. By growing DataGrid element size, switching tabs becomes VERY slow ! After that I found this post reading the blog from Bea Stolnitz as supposed by the previous answer. That gave me the hint to google "wpf tabcontrol VirtualizingStackPanel" which gives me the link to DrWPF: http://groups.google.com/group/wpf-disciples/browse_thread/thread/6f3531a1720252dd

He describes exactly the problem and gives the solution :-))

.... The perf hit is during the building of the tree. Unfortunately, if
you're using a typical MVVM approach with a binding on the ItemsSource
property of the TabControl, the entire tree must be rebuilt each time
a tab item is selected. This is usually a very expensive operation. ....

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!