Reputation: 2450
I added the below code for implement toolkit animation in my application. But it works on the emulator perfectly but in the device nothing is happening, I think the animation happens very fastly or nothing is happening. I cant able to rectify the issue yet. Please some one help me to resolve the issue.
TurnstileTransition turnstileTransition = new TurnstileTransition();
turnstileTransition.Mode = TurnstileTransitionMode.BackwardOut;
PhoneApplicationPage phoneApplicationPage =
(PhoneApplicationPage)(((PhoneApplicationFrame)
Application.Current.RootVisual)).Content;
ITransition transition = turnstileTransition.GetTransition(phoneApplicationPage);
transition.Completed += delegate { transition.Stop(); };
transition.Begin();
Upvotes: 2
Views: 601
Reputation: 7770
You have to replace
RootFrame = new PhoneApplicationFrame();
with
RootFrame = new TransitionFrame();
it's inside #region Phone application initialization
in App.xaml.cs,
Upvotes: 4
Reputation: 3217
You can try the XAML alternatives there are examples here and here
Sample:
<!-- Navigation Animations -->
<toolkit:TransitionService.NavigationInTransition>
<toolkit:NavigationInTransition>
<toolkit:NavigationInTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardIn"/>
</toolkit:NavigationInTransition.Backward>
<toolkit:NavigationInTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardIn"/>
</toolkit:NavigationInTransition.Forward>
</toolkit:NavigationInTransition>
</toolkit:TransitionService.NavigationInTransition>
<toolkit:TransitionService.NavigationOutTransition>
<toolkit:NavigationOutTransition>
<toolkit:NavigationOutTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardOut"/>
</toolkit:NavigationOutTransition.Backward>
<toolkit:NavigationOutTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardOut"/>
</toolkit:NavigationOutTransition.Forward>
</toolkit:NavigationOutTransition>
</toolkit:TransitionService.NavigationOutTransition>
<!-- EO Navigation Animations-->
Upvotes: 0