简体   繁体   中英

Possible to get smooth scrolling WITH virtualization in wrappanel wpf?

I have a wrap panel that is virtualized using the following link:

http://virtualwrappanel.codeplex.com/

I have implemented dragging and dropping on top that...howewver, when I drag items down, I am using the methods LineUp() and LineDown() to move down the wrap panel. Because of virtualization this transition looks very choppy and not good...Is it possible to achieve smooth scrolling in this case? Thanks

It's likely that the items you're virtualizing are very expensive to render, either because of a complex visual tree or because of expensive code needed to produce them. Try testing the same number of items, but with a very simple display, say a TextBlock with Text="foobar" . This should scroll smoothly for you - at least it does for me.

So to debug your efficiency problem, you could take a look at the WPF performance suite and the Visual Studio performance analyzer (or similar 3rd party tools). The WPF performance suite will narrow down the general area of problem (is it actual rendering code? Or is the Dispatcher getting clogged up?) and the VS performance analyzer will help you find areas for streamlining in your own code if that happens to be the problem. If rendering is the problem, reducing your visual tree complexity will solve the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM