1 minute read

Creating page transitions is not difficult at all when you have Silverlight Toolkit available in market.  So follow the steps written below

Step 1: Using Silverlight Toolkit

So first download the latest copy of Silverlight Toolkit and follow the steps belowAdd a reference of Microsoft.Phone.Controls.Toolkit in your application

Step 2: Modify App.xaml.cs

Next modify App.xaml.cs to enable loading a page with transitions instead of a normal page.

Find out,  this line

[sourcecode language='c#']

RootFrame = new PhoneApplicationFrame();
[/sourcecode]

This has to be replaced by

[sourcecode language='c#']
RootFrame = new Microsoft.Phone.Controls.TransitionFrame();
[/sourcecode]

Step 3: Apply transitions to page

Add the XML name space for toolkit in your page first if it is not already presented:
[sourcecode language='c#']
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
[/sourcecode]

Now, add appropriate transition to your page (not as a resource).  Few samples are as shown below:

Example 1: Rotate pages when loading and exiting

[sourcecode language='xml']




















[/sourcecode]

Example 2: Turnstile motion when loading and exiting

[sourcecode language='xml']




















[/sourcecode]

Step 4: You are done!

Execute your application and see the page transitions working fine!