2

当我使用情节提要在 wpf 中运行动画时,在输出窗口中出现以下错误。

System.Windows.Media.Animation 警告:6:无法执行操作,因为指定的情节提要从未应用于此对象以进行交互式控制。行动='停止'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='57850459'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='System.Windows.Media.Animation.Storyboard'; TargetElement.HashCode='57850459'; TargetElement.Type='System.Windows.Media.Animation.Storyboard'

谁能告诉我它将如何影响我的程序以及如何删除它?

我没有在 .xaml 文件中定义故事板。但是当设计文件(.xaml)后面的代码我在类中创建了私有存储板时,我使用以下代码语法将其分配给框架元素。

this.storyboard1.Begin(this.viewbox1, true);

其中storyboard1 是我在类中创建的对象,viewbox1 是我要应用此动画的元素。

有谁能够帮我?提前致谢。

4

1 回答 1

2

我也有这个警告,但发现 Begin 调用中指定的“包含元素”也必须在 Stop 调用中指定,这应该消除警告。

this.storyboard1.Begin(this.viewbox1, true);

this.storyboard1.Stop(this.viewbox1);
于 2014-03-12T06:23:14.967 回答