Tuesday 8 November 2011

Adding Page Transition Effect in Silverlight Application

In MSVS2010 Create a new Silverlight Navigation Project.
In Silverlight project, right click MainPage.xaml and select Open in Expression Blend.
In Objects and Timeline tab find (UserControl>LayoutRoot>ContentBorder>ContentFrame)
Right click ContentFrame > Edit Template > Edit a copy.
A Create ControlTemplate Resource box will appear.
Name the Key: CustomTransitioningNavFrame.
In Define In:  Choose Resource dictionary and press New... button.
New Item box will appear, name the new dictionary: CustomControls.xaml and press Ok.
Back to the earlier box, choose our new file CustomControls.xaml and press OK.
Delete the ContentPresenter control.
While Border selected add TransitioningContentPresenter control.
Modify XAML of the TCP control,
 Set Transition= DefaultTransition, Normal, UpTransition and DownTransition.
 Set Content={TemplateBinding Content}.
We are done with the minimum Transition effect. We can add our custom transition effect, but this is not covered in this post.

No comments:

Post a Comment