How do I programmatically run an animation?

You can progrmatically run an animation by loading the Storyboard into memory and calling it's Begin() method.

For example:

Storyboard sb = (Storyboard)this.Resources["LookUp"];
sb.Begin(this.ellPupil);

In this code, the name of the Storyboard is "LookUp", and in the call to the Storyboard's Begin() method, the object to which the animation applies is passed.


© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 10/23/10
Comment or report problem with topic