系统.视窗.媒体.动画警告: 6.

本文关键字:警告 动画 视窗 媒体 系统 | 更新日期: 2023-09-27 18:31:24

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

系统.Windows.媒体.动画警告: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)背后的代码时,我在类中创建了私有stoaryboard,我使用以下代码语法将其分配给框架元素。

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

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

有人可以帮助我吗?提前谢谢。

系统.视窗.媒体.动画警告: 6.

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

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