Animation in Code - Clock vs Storyboard RRS feed

  • Question

  • I have a couple of genarlized animation questions that hopefully will be easy to answer by you gurus...

    • If you are doing all your animation in code, is there any advantage to using the Storyboard method vs the Clock method?
    • Whats the best way to add an animation complete handler (DoubleAnimation.Completed vs DoubleAnimation.CurrentStateInvalidated)
    • If you are using the Clock method, how do you remove the clock in the animation complete handler - assuming that the FillBehavior is HoldEnd? (Assuming the animation was started using item.ApplyAnimationClock()




    - j

    Tuesday, November 28, 2006 7:01 PM

All replies

    • For code applications, Stoyboards provide additional conveniences for managing sets of animations together.  If you do not need this additional level of animation management, then there will be no advantage.  For example, if you have a single ColorAnimation being used in code, there is no need to put that single ColorAnimation as the sole child of a Storyboard.
    • If you care about the completion of the animation, you want to listen to the Completed event.  Since this seemed like an obvious answer, there's probably more to your question.  If you can clarify why you were even considering CurrentStateInvalidated, we can give more details.
    • Call ApplyAnimationClock again, but pass in a null for the clock parameter.
    • Proposed as answer by felipet Wednesday, December 8, 2010 12:05 AM
    Tuesday, December 5, 2006 2:19 AM