So you want your Windows Phone 7 application to have nifty transitions similar to how the native apps on the phone work. Most commonly you see the turnstile effect or the slide effect.

4341.WpTkOct10_2D00_TransitionFrame[1]

With the Silverlight Toolkit for Windows Phone, it is pretty darned easy. Download sample code. Here’s how:

 

  1. Download and install the toolkit. It gets installed to C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Toolkit\Nov10\Bin\Microsoft.Phone.Controls.Toolkit.dll if you were wondering. It should automatically appear as an option  as Microsoft.Phone.Controls.Toolkit when you go to add a reference.
  2. Change your app.xaml.cs file in the InitializePhoneApplication() method so that RootFrame is of type TransitionFrame:
  3. Then, under the root element of each page (which should be <phone:PhoneApplicationPage> add the transition you want. You'll need to add the xmlns to dll, like this: xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    1. If you want Turnstile transtion, it would look like this:
    2. If you want Slide transitions, it would look like this:

And that’s it! You can also play around with the other transition modes supported, which are roll, swivel and rotate.

Download sample code.