Click here to Skip to main content
Licence CC (ASA 2.5)
First Posted 21 Jul 2009
Views 47,843
Downloads 2,031
Bookmarked 34 times

Silverlight Page Flip Navigation

It describes page to page navigation with flip animation in Silverlight

Introduction

This article describes how to navigate between pages with flip animation in Silverlight.

Using the Code

The flip animation can be done with the help of PlaneProjection from the namespace System.Windows.Media. You must use the below code snippet in all the XAML pages that needs the flip animation:

<Grid.Projection>
   <PlaneProjection x:Name="Projection"/>
</Grid.Projection>

And in the code base, add a double animation storyboard to flip the page: 

DoubleAnimation daY1 = new DoubleAnimation { From = 0.00, To = 90.00 };
Storyboard.SetTargetName(daY1, "Projection");
Storyboard.SetTargetProperty(daY1, new PropertyPath("RotationX"));
stb1.Children.Add(daY1);
this.Resources.Add("EndOfPage", stb1);
Storyboard stb = new Storyboard();
stb.Duration = new Duration(TimeSpan.FromSeconds(1));
stb.SpeedRatio = 3;
DoubleAnimation daY = new DoubleAnimation { From = -90.00, To = 0.00 };
Storyboard.SetTargetName(daY, "Projection");
Storyboard.SetTargetProperty(daY, new PropertyPath("RotationX"));
stb.Children.Add(daY);
this.Resources.Add("StartOfPage", stb);

And use this method to navigate from page to page:

public void SwitchToPage(UserControl p)
{
    NextPage = p;
    if (CurrentPage != p)
    {
        Storyboard currStb = CurrentPage.Resources["EndOfPage"] as Storyboard;
        currStb.Completed += new EventHandler(currStb_Completed);
        currStb.Begin();
    }
}

History

  • 21st July, 2009: Initial post

License

This article, along with any associated source code and files, is licensed under The Creative Commons Attribution-ShareAlike 2.5 License

About the Authors

Venkatesan Jagadisan

Software Developer
iSOFT
India India

Member

Working as a Software Engineer in iSOFT at Chennai, India.

Balaji Ganesaan

Software Developer (Senior)
iSOFT
India India

Member

Working as a Senior Software Engineer in iSOFT at Chennai, India.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
BugI need Help with public void SwitchToPage(UserControl p) in vb.net Pinmemberder220120:11 8 Aug '11  
GeneralMy vote of 2 PinmemberMichael Eber7:51 31 Dec '09  
GeneralMy vote of 1 Pinmemberwaletzky16:20 15 Sep '09  
QuestionExcellent Article,but one question! PinmemberGomathiR1:06 25 Aug '09  
AnswerRe: Excellent Article,but one question! Pinmemberkamrajj3:18 25 Aug '09  
GeneralRe: Excellent Article,but one question! PinmemberGomathiR20:39 25 Aug '09  
QuestionGood work but i dont know what am I missing Pinmemberkamrajj0:00 24 Aug '09  
Generaldocumentation please PinmemberTJDOAD11:04 12 Aug '09  
Generalcool code Pinmemberforgetuu17:54 11 Aug '09  
GeneralMy vote of 1 Pinmemberpositronvx22:15 27 Jul '09  
GeneralMy vote of 1 PinmemberMichael E. Jones21:33 27 Jul '09  
GeneralRe: My vote of 1 Pinmemberjasenschmidt19:29 3 Aug '09  
GeneralMy vote of 2 Pinmemberlneir15:48 27 Jul '09  
GeneralCool code, not so cool article Pinmemberblackjack215020:43 21 Jul '09  
Generalexcellent Pinmemberarun123@poll20:23 21 Jul '09  
GeneralMy vote of 1 PinmemberMW_Justin6:15 21 Jul '09  
GeneralRe: My vote of 1 PinmemberVenkatesan Jagadisan7:18 21 Jul '09  
GeneralMy vote of 2 Pinmemberemilio_grv2:25 21 Jul '09  
GeneralRe: My vote of 2 PinmemberBalaji Ganesaan19:02 21 Jul '09  
GeneralRe: My vote of 2 Pinmemberemilio_grv4:05 1 Jan '10  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 21 Jul 2009
Article Copyright 2009 by Venkatesan Jagadisan, Balaji Ganesaan
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid