Newbie Getting started question

2 posts, 0 answers
  1. Gary Blakely
    Gary Blakely avatar
    63 posts
    Member since:
    Jan 2010

    Posted 10 Jun 2011 Link to this post

    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;
            }

  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 13 Jun 2011 Link to this post

    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>>
  3. DevCraft banner
Back to Top