我创建了一个 Silverlight 应用程序。我想翻转图像,所以我从后面的代码创建了一个故事板。但它抛出错误"Cannot resolve target name Imagename"。
Storyboard sbFlip = new Storyboard();
sbFlip.Duration = new Duration(TimeSpan.FromSeconds(3));
DoubleAnimationUsingKeyFrames FlipFront = new DoubleAnimationUsingKeyFrames();
DoubleAnimationUsingKeyFrames FlipBack = new DoubleAnimationUsingKeyFrames();
Storyboard.SetTargetName(FlipFront, strFrontSelectedValue);
Storyboard.SetTargetName(FlipBack, strBackSelectedValue);
Storyboard.SetTargetProperty(FlipFront, new PropertyPath("(UIElement.RenderTransform).(ScaleTransform.ScaleX)"));
Storyboard.SetTargetProperty(FlipBack, new PropertyPath("(UIElement.RenderTransform).(ScaleTransform.ScaleX)"));
SplineDoubleKeyFrame sFlipFront = new SplineDoubleKeyFrame();
SplineDoubleKeyFrame sFlipBack = new SplineDoubleKeyFrame();
sFlipFront.KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(500));
sFlipFront.Value = 0;
sFlipBack.KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(500));
sFlipBack.Value = 1;
FlipFront.KeyFrames.Add(sFlipFront);
FlipBack.KeyFrames.Add(sFlipBack);
sbFlip.Children.Add(FlipFront);
sbFlip.Children.Add(FlipBack);
sbFlip.AutoReverse = true;
sbFlip.Completed += new EventHandler(this.sbFlip_Completed);
sbFlip.Begin();
我哪里错了???