How to set transition from code behind?

5 posts, 1 answers
  1. bill
    bill avatar
    31 posts
    Member since:
    Sep 2007

    Posted 13 Jul 2010 Link to this post



    Hello Telerik,


      Could you please show me how to set this transition from code behind? I have a frame that i would like to add different transition to depending on the page the user selects.

    <navigatio:Frame x:Name="DetailsFrame" Grid.ColumnSpan="2"  Grid.Row="5" Grid.Column="0"   Margin="8,10,30,9" Width="Auto" >
                    <navigatio:Frame.Background>
                        <ImageBrush Stretch="Fill"/>
                    </navigatio:Frame.Background>
                <navigatio:Frame.Template>
                    <ControlTemplate TargetType="navigatio:Frame">
                        <telerik:RadTransitionControl  Duration="0:0:0.8" Name="trnx" Content="{TemplateBinding Content}">
                            <telerik:RadTransitionControl.Transition>
                                <transitions:SlideAndZoomTransition
                                  
                                  
                                >
      
                                </transitions:SlideAndZoomTransition>
                            </telerik:RadTransitionControl.Transition>
                              
                        </telerik:RadTransitionControl>
                    </ControlTemplate>
                </navigatio:Frame.Template>
            </navigatio:Frame>
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 14 Jul 2010 Link to this post

    Hello Bill,

     You could use the following code:

    transitionControl.Transition = new SlideAndZoomTransition();
    where transitionControl is your RadTransitionControl.

    All the best,
    Miroslav Nedyalkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. bill
    bill avatar
    31 posts
    Member since:
    Sep 2007

    Posted 14 Jul 2010 Link to this post


    Hi Miroslav and thank you for the reply.

    I am unable to get a reference to the transition control is the problem. i wasnt sure if i had to use findcontrol or something because it is a inside the frame. also what namespace are you importing to get the transition types? anything besides the Telerik.Windows.Controls.dll? i have tried declaring the control name as: but cant get a referecne to it in the code behind
    Name="trnx"  and x:Name="trnx"

  5. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 15 Jul 2010 Link to this post

    Hello Bill,

     The easiest way to get reference to the transition control is to hook-up to its Loaded event and to cast the sender of the handler to RadTransitionControl and save this reference for further use.

    The Transitions are in the Telerik.Windows.Controls.TransitionEffects namespace. They are all inheriting from the TransitionProvider class and their names end with Transition. 

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. bill
    bill avatar
    31 posts
    Member since:
    Sep 2007

    Posted 15 Jul 2010 Link to this post

    thats what i was looking for! thanks
Back to Top
DevCraft banner