RadScaleAndFadeAnimation scale issues after AutoReverse

2 posts, 0 answers
  1. Erik
    Erik avatar
    2 posts
    Member since:
    Apr 2012

    Posted 17 Jun 2012 Link to this post

    I have the below code running, when the button finishes growing then shrinking back it then flashes to the endScale sizes and EndOpacity even though AutoReverse is set to true.            

    XAML
        <Canvas x:Name="LayoutRoot" Background="Transparent" VerticalAlignment="Top" d:DataContext="{d:DesignData /SampleData/vehicleSampleData.xaml}" >
            <Canvas.Resources>
                <telerikCore:RadScaleAndFadeAnimation x:Key="radScaleAndFadeAnimation" Duration="0:0:1" AutoReverse="True"/>
            </Canvas.Resources>
    ...
    ...

    C#
    Global Variable:
    public RadScaleAndFadeAnimation scaleAnimation;

    in initialize code:
    scaleAnimation = this.LayoutRoot.Resources["radScaleAndFadeAnimation"] as RadScaleAndFadeAnimation;
                scaleAnimation.ScaleAnimation.StartScaleX = 1;
                scaleAnimation.ScaleAnimation.StartScaleY = 1;
                scaleAnimation.ScaleAnimation.EndScaleX = 1.5;
                scaleAnimation.ScaleAnimation.EndScaleY = 1.5;
                scaleAnimation.FadeAnimation.StartOpacity = .8;
                scaleAnimation.FadeAnimation.EndOpacity = .5;
                scaleAnimation.Ended += new EventHandler<EventArgs>(scaleAnimation_Ended);

    Then in a button click I call on the button that's clicked:
    RadAnimationManager.Play(item1SelectButton, scaleAnimation);
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 20 Jun 2012 Link to this post

    Hello Erik,

    Thank you for the question.
    You just need to call the ApplyInitialValues method of the scale animation in the Ended event handler. For example:

    void scaleAnimation_Ended(object sender, EventArgs e)
    {
        scaleAnimation.ApplyInitialValues(this.button);
    }
    Please write again if you have other questions.

    All the best,
    Victor
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top