简体   繁体   中英

WP7 Updating the UI while scrolling (Mango)

A while back I wrote a Windows Phone 7 Jump List control:

http://www.scottlogic.co.uk/blog/colin/2011/01/a-windows-phone-7-jump-list-control/

I have had a number of requests from people to add a 'mango' style 'sticky' category header at the top of the jump list. I have added a category header to the top of the control and have worked out how to update its location so that it slides into place as the list scrolls, however, Mango is causing me a few issues ...

With NoDo, I update my UI as the ScrollViewer scrolls by locating the Scrollbar within the ScrollViewer template and handling the ValueChanged event. This works fine on my NoDo phone.

However, I have the Mango developer tools, and when I run the same code in the emulator, the 'sticky' category header location jumps rather than moving smoothly. My guess is that this is in some way related to the scrolling improvements in Mango, is the UI being updated via the render / compositor thread without the ValueChanged event being fired?

I have also tried updating the UI via CompositionTarget.Rendering, again this is jumpy in Mango. Also, with WP7 controls not implementing IDisposable, it is hard to determine when to remove the subscription to this event.

So, does anyone have an idea how I can solve this issue? How can I smoothly update my UI in response to vertical scrolling on a Mango WP7 device?

You can opt out of the mango performance improvements for scrolling by setting ScrollViewer.ManipulationMode="Control" attached property as described on the Silverlight for Windows Phone Performance team blog . I would expect this to resolve the problems you've been having.

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