This is a migrated thread and some comments may be shown as answers.

Newbie Getting started question

1 Answer 76 Views
PhoneApplicationFrame
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gary Blakely
Top achievements
Rank 1
Gary Blakely asked on 10 Jun 2011, 05:46 PM

I am trying to follow your docs for PhoneApplicationFrame in order to get various page transitions to work.  I have a new wp7 project with the main page and a 2nd page.  When the button is clicked on the main page I do a manual navigation to the second page like so:

NavigationService.Navigate(new Uri("/Pages/Settings.xaml", UriKind.Relative));

So that I can see the pages I have set their backgrounds to different colors.  Following your docs, my InitializePhoneApplication method in app.xaml.cs looks as pasted below.

However, there is no transition at all.  Your docs really don't show how to do this.  They talk about it but there is no complete example.  When I look at your example project (ExamplesCS_WP) I see you don't even have a InitializePhoneApplication event much less the code below so that's confusing.

Can you help get me started?
Thanks, Dean

 

THIS CODE IN APP.XAML.CS..........................................................
       private void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
                return;
            RadTransition transition = new RadTransition();
            transition.BackwardInAnimation = this.Resources["fadeInAnimation"] as RadFadeAnimation;
            transition.BackwardOutAnimation = this.Resources["fadeOutAnimation"] as RadFadeAnimation;
            transition.ForwardInAnimation = this.Resources["fadeInAnimation"] as RadFadeAnimation;
            transition.ForwardOutAnimation = this.Resources["fadeOutAnimation"] as RadFadeAnimation;
            transition.PlayMode = TransitionPlayMode.Consecutively;

            // Create the frame but don't set it as RootVisual yet; this allows the splash
            // screen to remain active until the application is ready to render.
            RootFrame = new PhoneApplicationFrame();
            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // Handle navigation failures
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // Ensure we don't initialize again
            phoneApplicationInitialized = true;
        }

1 Answer, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 13 Jun 2011, 07:29 AM
Hello Gary Blakely,

You are right - we need to improve our help for this control. The help update is already scheduled.

For the moment your best resource will be this blog post, which contains a very simple demo application that show how to setup the page transitions and also the usage of the most available transitions.
http://blogs.telerik.com/valentinstoychev/posts/11-02-21/page_transitions_for_wp7_-_sample_application.aspx#comments

Here is the code that needs to be added:
private void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
                return;
  
            // Create the frame but don't set it as RootVisual yet; this allows the splash
            // screen to remain active until the application is ready to render.
            RootFrame = new RadPhoneApplicationFrame();
            RootFrame.Navigated += CompleteInitializePhoneApplication;
  
            // Handle navigation failures
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;
  
            // Ensure we don't initialize again
            phoneApplicationInitialized = true;
        }

If you still have any problems using the transitions - please let us know.

Kind regards,
Valentin.Stoychev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
PhoneApplicationFrame
Asked by
Gary Blakely
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Share this question
or