I want to dynamically, from C#, do something like this:
Ok! I figured out the C# equivalent.
ObjectAnimationUsingKeyFrames animation = new ObjectAnimationUsingKeyFrames();
animation.BeginTime = TimeSpan.FromSeconds(0);
Storyboard.SetTarget(animation, image);
Storyboard.SetTargetProperty(animation, new PropertyPath("(Image.Source)"));
DiscreteObjectKeyFrame keyFrame = new DiscreteObjectKeyFrame(BitmapFrame.Create(uri), TimeSpan.FromSeconds(0.7));
animation.KeyFrames.Add(keyFrame);
myStoryboard.Children.Add(animation);
myStoryboard.Begin();
I used "SetTarget" instead of "SetTargetName"