Join the DZone community and get the full member experience.
Join For Free
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.
Published at DZone with permission
, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.