Original Post
In the Win Phone 7 version of Silverlight, I am trying to animate the FontSize property of a TextBlock. I am getting an unhelpful error that I usually get when I specify a property that a dependency doesn't contain. Code looks like this, Are there a lot of issues with property animations like this? Another thing I was trying to do was animate a Margin property of an Image, but there is no MarginProperty (and the MSDN docs note that it's missing). [Edited by - ferr on May 8, 2010 7:36:28 PM]
//animate text size
DoubleAnimation da = new DoubleAnimation();
da.Duration = new Duration(TimeSpan.FromSeconds(4.0));
da.From = 10;
da.To = 30;
Storyboard sbText = new Storyboard();
sbText.Duration = TimeSpan.FromSeconds(4.0);
Storyboard.SetTarget(da, gameResult);
Storyboard.SetTargetProperty(da, new PropertyPath(FontSizeProperty));
sbText.Children.Add(da);
sbText.Begin(); //Unhelpful error on this call
gameResult.Text = "Player Busted!";