System.Windows.Media.Animation警告:6

当我使用故事板在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文件中定义storyboard。 但是当设计文件(.xaml)背后的代码我在类中创建了私有stoaryboard时,我使用代码中的以下语法将其分配给framework元素。

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

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

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

我也有这个警告,但发现在Begin调用中指定的’containedElement’也必须在Stop调用中指定,这应该消除警告。

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