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

Page specific transitions

12 Answers 219 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.
Stefano
Top achievements
Rank 1
Stefano asked on 10 Feb 2011, 09:30 AM
hi,
i've just started with your wonderfull toolkit for WP7 and i have a question:
is it possible to specify different transitions for the various pages composing my application, instead of defining only one to be used across the entire application ?
i'm talking about something similar to the Toolbox for Windows Phone where you can declare in XAML the transition to be used with each page.

12 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 10 Feb 2011, 02:37 PM
Hi Stefano,

You can use the RadTransitionControl.Transition attached property to accomplis this. Just place this code in the definition of your page:

<telerikPrimitives:RadTransitionControl.Transition>
      <!-- specify here the transition you want to use -->
      <telerikPrimitives:RadTileTransition/>
</telerikPrimitives:RadTransitionControl.Transition>

Here is the full sample code:

<phone:PhoneApplicationPage 
    x:Class="Telerik.Examples.WP.PhoneApplicationFrame.Wizard.Page1"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Core"
    xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"
    xmlns:local="clr-namespace:Telerik.Examples.WP.PhoneApplicationFrame.Wizard"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"    
    mc:Ignorable="d" d:DesignHeight="728" d:DesignWidth="480"
    Background="Black"
    shell:SystemTray.IsVisible="False">
    <telerikPrimitives:RadTransitionControl.Transition>
        <telerikPrimitives:RadTileTransition/>
    </telerikPrimitives:RadTransitionControl.Transition>  
....

Please let us know it this works for you.

Best wishes,
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>>
0
Stefano
Top achievements
Rank 1
answered on 14 Feb 2011, 05:06 PM
thanks a lot,
i've menaged to include the code and achieve per page transitions but I still have a question: why can i only make some transition to work ? (or better, what am I actually missing ? :) )
I've tested some and for example with RadFadeTransition or RadScaleTransition or RadSlideTransition I get the desired result, but no luck in using RadTileTransition or RadTurnstileTransition.
I'm just testing on a simple two pages application, with some random items placed inside a grid.
Stefano
0
Accepted
Valentin.Stoychev
Telerik team
answered on 21 Feb 2011, 12:48 PM
Hello Stefano,

I've created a sample project which demonstrates how to use the transitions. Please take a look at it and let us know if you still have any problems.

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>>
0
nodd13
Top achievements
Rank 1
answered on 22 Feb 2011, 12:28 PM
How do I use a custom transition in this scenario. Using the code from the example a custom transition can be defined as:

<UserControl.Resources>
   <telerikCore:RadFadeAnimation x:Key="fadeInAnimation"
                                   StartOpacity="0.0"
                                   EndOpacity="1.0" />
   <telerikCore:RadFadeAnimation x:Key="fadeOutAnimation"
                                   StartOpacity="1.0"
                                   EndOpacity="0.0" />
   <telerikPrimitives:RadTransition x:Key="MyTransition"
                                       PlayMode="Consecutively"
                                       ForwardInAnimation="{StaticResource fadeInAnimation}"
                                       ForwardOutAnimation="{StaticResource fadeOutAnimation}"
                                       BackwardInAnimation="{StaticResource fadeInAnimation}"
                                       BackwardOutAnimation="{StaticResource fadeOutAnimation}">
   </telerikPrimitives:RadTransition>
</UserControl.Resources>

but how do I point the RadTransitionControl.Transition attached property to the new transition.  
0
Valentin.Stoychev
Telerik team
answered on 22 Feb 2011, 12:35 PM
Hi Umar,

you can use the following syntax:
<phone:PhoneApplicationPage.Resources>
        <telerikCore:RadFadeAnimation x:Key="fadeInAnimation"
                                   StartOpacity="0.0"
                                   EndOpacity="1.0"/>
        <telerikCore:RadFadeAnimation x:Key="fadeOutAnimation"
                                   StartOpacity="1.0"
                                   EndOpacity="0.0"/>
    </phone:PhoneApplicationPage.Resources>
  
  
    <telerikPrimitives:RadTransitionControl.Transition>
        <telerikPrimitives:RadTransition
                                       PlayMode="Consecutively"
                                       ForwardInAnimation="{StaticResource fadeInAnimation}"
                                       ForwardOutAnimation="{StaticResource fadeOutAnimation}"
                                       BackwardInAnimation="{StaticResource fadeInAnimation}"
                                       BackwardOutAnimation="{StaticResource fadeOutAnimation}">
        </telerikPrimitives:RadTransition>
  
    </telerikPrimitives:RadTransitionControl.Transition>

Let us know if you have more questions!

Best wishes,
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>>
0
nodd13
Top achievements
Rank 1
answered on 22 Feb 2011, 01:23 PM
Thanks a lot, that works perfectly.
0
Stefano
Top achievements
Rank 1
answered on 28 Feb 2011, 12:07 PM
Thanks a lot for the samples, i was missing this line
this.SetValue(RadTileAnimation.ContainerToAnimateProperty, this.TileContainerListBox);
to properly start the animation.
Stefano
0
Derek
Top achievements
Rank 1
answered on 15 Mar 2012, 01:29 AM
I tried this example and get, RadFadeAnimation is not found.  I'm trying to change the Duration of the fadeout.  
0
Todor
Telerik team
answered on 15 Mar 2012, 05:19 PM
Hello Derek,

Thank you for contacting us.

Please confirm that you have referenced the assembly: Telerik.Windows.Core.dll
and that you have added an xmlns statement in the root tag mapping a prefix to the CLR namespace Telerik.Windows.Controls from the assembly Telerik.Windows.Core. Then you can try to rebuild the solution and you should find the RadFadeAnimation. To change the duration of the fadeout, you just have to set the animation's Duration property to a new Duration.

Please, let me know if you need additional assistance.

All the best,
Todor
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Derek
Top achievements
Rank 1
answered on 15 Mar 2012, 09:02 PM
I believe I have all the refs correct.  I'm on the latest release.
I reference:
Telerik.WIndows.Controls.Data
Telerik.WIndows.Controls.Primitives
Telerik.WIndows.Core
Telerik.WIndows.Data

My xmls statement is:
 xmlns:telerik="http://schemas.telerik.com/windowsphone"

In Resources for the page...
<phone:PhoneApplicationPage.Resources>              
            <telerik:RadFadeAnimation x:Key="fadeInAnimation"
                                          StartOpacity="0.0"
                                          EndOpacity="1.0" />
            <telerik:RadFadeAnimation x:Key="fadeOutAnimation"
                                          StartOpacity="1.0"
                                          EndOpacity="0.0" />
    </phone:PhoneApplicationPage.Resources>


Then:
<telerik:RadTransitionControl.Transition>
       <telerik:RadTransition PlayMode="Consecutively"
                                        ForwardInAnimation="{StaticResource fadeInAnimation}"
                                        ForwardOutAnimation="{StaticResource fadeOutAnimation}"
                                        BackwardInAnimation="{StaticResource fadeInAnimation}"
                                        BackwardOutAnimation="{StaticResource fadeOutAnimation}">
       </telerik:RadTransition>
 
   </telerik:RadTransitionControl.Transition>

Yet, this works fine:
<telerik:RadTransitionControl.Transition>
        <telerik:RadSlideTransition />
    </telerik:RadTransitionControl.Transition>
0
Todor
Telerik team
answered on 16 Mar 2012, 01:15 PM
Hello Derek,

As you can read from my previous post and from our online documentation here, the correct xmlns is:

xmlns:telerikCore="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Core"

You can change the prefix of course, just make sure it is the same as the one that you use in the application.

I hope this helps.

Regards,
Todor
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Derek
Top achievements
Rank 1
answered on 16 Mar 2012, 11:40 PM
Thanks Todor that worked,

I didn't noticed Resharper changing the namespace.
Tags
PhoneApplicationFrame
Asked by
Stefano
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Stefano
Top achievements
Rank 1
nodd13
Top achievements
Rank 1
Derek
Top achievements
Rank 1
Todor
Telerik team
Share this question
or