I believe, because there is no relationship with your code created between the Storyboard and TextBlock Text DependencyProperty animation clock. if I had to guess, I would say when the Storyboard was going, it was at a somewhat random time due to pollution by the DependencyProperty update stream (TextBlock.Text - DependencyProperty). Creating such an association as shown below (either RunTimeline or RunStoryboard will work, but show alternative search methods):
public partial class Window1 : Window { Storyboard a = new Storyboard(); StringAnimationUsingKeyFrames timeline = new StringAnimationUsingKeyFrames(); DiscreteStringKeyFrame keyframe = new DiscreteStringKeyFrame(); int i; public Window1() { InitializeComponent();
This works for me as long as I let him work (~ 10 times longer than ever to win).
Tim
source share