How to: Animate a String by Using Key Frames

This example shows how to animate a string, which in this example is the Content property of a Button control, by using key frames.

Example

The following example uses the StringAnimationUsingKeyFrames class to animate the Content property of a Button.

All the key frames in this example use an instance of the DiscreteStringKeyFrame class because a string animation that is created with key frames can only use discrete key frames. Discrete key frames like DiscreteStringKeyFrame create sudden jumps between values, that is, changes to the animation occur quickly and are not subtle.

      

See also