2

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();
6
  • TurnstileTransition is fairly heavy, try commenting out your code especially data bindings and run the animation again, see if it works.
    – Justin XL
    Commented Oct 18, 2011 at 6:34
  • I tried, but the result is same...And one interesting thing is that, no such hvy code ir running out there.. still the animation not responds :)
    – StezPet
    Commented Oct 18, 2011 at 7:11
  • Oh another thing, do you call your animation in the pages loaded event?
    – Justin XL
    Commented Oct 18, 2011 at 7:39
  • I added the code in OnNavigatedTo Event. Insted of Load..
    – StezPet
    Commented Oct 18, 2011 at 7:41
  • Try downloading the sample code from the toolkit, I am pretty sure you can do this kinda of animations in xaml rather than code behind. This might be because the animation happens before the UI is loaded.
    – Justin XL
    Commented Oct 18, 2011 at 8:03

2 Answers 2

4

You have to replace

RootFrame = new PhoneApplicationFrame();

with

RootFrame = new TransitionFrame();

it's inside #region Phone application initialization in App.xaml.cs,

1
  • 1
    In my particular case this was what was missing. Commented Feb 17, 2012 at 0:21
0

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-->
2
  • your answer doesnt make any sence.... Both are doing the same thing. The issue is bcs of some other prob. Try to find out the exact ans nd not misslead the users.. Commented Oct 18, 2011 at 11:17
  • I thought the issue was peculiar and using the XAML instead of code behind might just solve the issue. Did not intend to mislead. Sorry about that.
    – abhinav
    Commented Oct 18, 2011 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.