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

Animation

9 Answers 284 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Oksana
Top achievements
Rank 1
Oksana asked on 17 Mar 2011, 03:58 PM
Hello,

can you please show an example of how to change the speed of transition animation when it is enabled for the extender control(telerik:AnimationManager.IsAnimationEnabled="True")

Thank you

9 Answers, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 19 Mar 2011, 05:49 PM
Hi Oksana,

With the latest official release you can take advantage of the Telerik AnimationManager to control the RadExpander animations in WPF:
<Style TargetType="telerik:RadExpander">
    <Setter Property="telerik:AnimationManager.AnimationSelector">
        <Setter.Value>
            <telerik:AnimationSelector>
                <telerik:ExpanderExpandCollapseAnimation
                                AnimationName
="Expand"
             Direction="In"
             TargetElementName="Content"
             SpeedRatio="0.2" />
                <telerik:ExpanderExpandCollapseAnimation
                                AnimationName="Collapse"
            Direction="Out"
            TargetElementName="Content"
            SpeedRatio="0.2" />
            </telerik:AnimationSelector>
        </Setter.Value>
    Setter>
</Style>
You can control the speed of the animation through the SpeedRatio property. I attached a sample project to help you get started. Let us know if we can further assist you.

All the best,
Tina Stancheva
the Telerik team
0
Oksana
Top achievements
Rank 1
answered on 21 Mar 2011, 03:20 PM
Thank you, Tina.
0
John
Top achievements
Rank 1
answered on 16 Nov 2015, 04:50 PM

This doesn't seem to work for Right expanding expanders?  Is there a different selector to handle that scenario?

<telerik:RadExpander
     ExpandDirection="Right"
     Header="MyHeader"
     Content="MyContent">
</telerik:RadExpander>

 

0
Nils
Top achievements
Rank 1
answered on 10 Oct 2016, 10:02 AM
I have encountered the same behavior as described by John with Q1 2016: ResizeDirection="Right" leads to the SpeedRatio of the animation being ignored. Any feedback on this?
0
Evgenia
Telerik team
answered on 13 Oct 2016, 10:14 AM
Hi John and Nils,

I'm currently looking on your case. I'll contact you soon with more information on it.

Regards,
Evgenia
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Evgenia
Telerik team
answered on 13 Oct 2016, 12:24 PM
Hi,

I investigated the case with Animations, (more specifically) SpeedRatio and different ExpandDirection-s. Everything is working as expected on my side. There's something important that should be mentioned here. When the ExpandDirection is set to Left or Right you should change the AnimationName so that it takes into consideration that you are animating the Width of the target and not Height as in other two cases. Now you might tweak the SpeedRatio property and you'll see that everything works as desired.
Here's an example:

<Window.Resources>
    <Style TargetType="telerik:RadExpander" BasedOn="{StaticResource RadExpanderStyle}" >
        <Setter Property="ExpandDirection" Value="Left" />
        <Setter Property="telerik:AnimationManager.AnimationSelector">
            <Setter.Value>
                <telerik:AnimationSelector>
                    <telerik:ExpanderExpandCollapseAnimation AnimationName="ExpandHorizontal"
                                                             Direction="In"
                                                             TargetElementName="Content"
                                                             SpeedRatio="0.2" />
                    <telerik:ExpanderExpandCollapseAnimation AnimationName="CollapseHorizontal"
                                                             Direction="Out"
                                                             TargetElementName="Content"
                                                             SpeedRatio="0.2" />
                </telerik:AnimationSelector>
            </Setter.Value>
        </Setter>
    </Style>
</Window.Resources>
<Grid>
    <telerik:RadExpander Header="MyHeader"
                         Content="MyContent">
    </telerik:RadExpander>
</Grid>

We'll update our documentation accordingly to avoid further confusions.

Regards,
Evgenia
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Nils
Top achievements
Rank 1
answered on 14 Oct 2016, 07:16 AM

Hi Evgenia,

that did the trick. Thanks!

Regards
Nils

0
Park
Top achievements
Rank 1
answered on 12 Feb 2018, 06:59 AM

Hi

It seems that SpeedRatio does not apply in the latest version.

Test version

2018.1.122.45

Thank you

0
Sia
Telerik team
answered on 14 Feb 2018, 11:41 AM
Hello,

I have tested it on my end and it seems that the SpeedRatio property works as expected. You can check the attached project and video.

Regards,
Sia
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Expander
Asked by
Oksana
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Oksana
Top achievements
Rank 1
John
Top achievements
Rank 1
Nils
Top achievements
Rank 1
Evgenia
Telerik team
Park
Top achievements
Rank 1
Sia
Telerik team
Share this question
or