Tech Off Thread

4 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Changing animation property dynamically in WINFX

Back to Forum: Tech Off
  • User profile image
    trun_gup

    I am using animation for transformations, but my requirement is i want to change its properties dynamically.

    DoubleAnimation myDoubleAnimationTranslateY = new DoubleAnimation();

    myDoubleAnimationTranslateY.From = 0;
    myDoubleAnimationTranslateY.To = -20;
    myDoubleAnimationTranslateY.Duration = new Duration(TimeSpan.FromSeconds(2));
    myDoubleAnimationTranslateY.AutoReverse = anistate;
    Storyboard.SetTargetName(myDoubleAnimationTranslateY, ink.Name);

    in this i want to change To and From properties dynamically. how can i accomplish this?

  • User profile image
    GRiNSER

    trun_gup wrote:

    I am using animation for transformations, but my requirement is i want to change its properties dynamically.

    DoubleAnimation myDoubleAnimationTranslateY = new DoubleAnimation();

    myDoubleAnimationTranslateY.From = 0;
    myDoubleAnimationTranslateY.To = -20;
    myDoubleAnimationTranslateY.Duration = new Duration(TimeSpan.FromSeconds(2));
    myDoubleAnimationTranslateY.AutoReverse = anistate;
    Storyboard.SetTargetName(myDoubleAnimationTranslateY, ink.Name);

    in this i want to change To and From properties dynamically. how can i accomplish this?


    do you want to change the To and From while the animation is running? or what do you want to do in particular?

  • User profile image
    trun_gup

    no i dont want to change To and From properties while the animation is running, its like i want to change these properties every time the animation starts fresh.

    i want a way by which i can use this same animation with characteristics varying.

  • User profile image
    trun_gup

    to be more specific , i need to change the To & From properties, after the animation is bound to a trigger event of some elements.

    eg- i bound an animation with btn click event, animation wrks fine, now if i want to change To and From property

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.