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

How to set transition from code behind?

4 Answers 185 Views
TransitionControl
This is a migrated thread and some comments may be shown as answers.
bill
Top achievements
Rank 1
bill asked on 13 Jul 2010, 11:27 PM


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>

4 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 14 Jul 2010, 08:19 AM
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
0
bill
Top achievements
Rank 1
answered on 14 Jul 2010, 05:46 PM

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"

0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 15 Jul 2010, 08:38 AM
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
0
bill
Top achievements
Rank 1
answered on 16 Jul 2010, 12:12 AM
thats what i was looking for! thanks
Tags
TransitionControl
Asked by
bill
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
bill
Top achievements
Rank 1
Share this question
or