Did you know? DZone has great portals for Python, Cloud, NoSQL, and HTML5!
Windows Phone Zone is brought to you in partnership with:

Erik works with Clarity’s creative team to provide interactive and innovative technology solutions. Erik's unique skill set helps bridge the gap between Clarity’s creative and technical teams. His experiences cover a vast range of creative and technical ground, which he has brought to bear for verticals ranging from entertainment to pharmaceuticals. Erik is a DZone MVB and is not an employee of DZone and has posted 8 posts at DZone. You can read more from them at their website. View Full User Profile

WP7 Cascade Behavior

06.30.2011
Email
Views: 1832
  • submit to reddit
It's so easy to get up and running with your first Windows Phone app!  Just pick up the FREE toolkit from Microsoft, register at AppHub, and start checking out some fundamental tutorials.
Windows Phone 7 is all about clean layouts and beautiful transitions. Unfortunately, we are left to generate many of these tranitions ourselves as WP7 will not ship with these great effects. The listbox shows of several . I put together a simple trigger action that allows you to apply cascading animations to a listbox. Simply create an animation in in a resource dictionary within your item template and reference it from your trigger action. You can write a custom delay generator as well as set the animation interval. Most importantly the animations respect virtualized lists; click on one of the items in the list to invoke the exit animation, once it has completed scroll down, you will see that items that were not in the view port were not animated, this ensures the best performance. In production you would hide the list or transition to a new page so these list items would never be seen. The code has not been fully tested and there are a few more features that would be nice to have but it is a good launching point. Take a look at ItemsControlExtensions for some great extension methods for virtualized items controls.
References
Published at DZone with permission of Erik Klimczak, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

The Windows Phone Microzone, which is supported by Microsoft, is your one-stop-shop for news, tutorials, perspectives, and research on the mobile platform that is making waves in smartphone ecosystem.