System.Windows.Media.Animation警告:6 [英] System.Windows.Media.Animation Warning: 6

查看:1652
本文介绍了System.Windows.Media.Animation警告:6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我用故事板我得到下面的输出窗口错误WPF运行动画。

When I run animation in wpf using storyboard I am getting following error in output window.

System.Windows.Media.Animation警告:6:无法因为指定的情节提要从未应用于此对象为
交互控制执行操作
;行动='停止';
故事板='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

System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='Stop'; 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'

谁能告诉我怎么会影响我的程序以及如何去除呢?

Can anyone tell me how it will affect my program and how to remove it?

我没有的.xaml文件中定义故事板。但是,当后面的设计文件(的.xaml)的代码,我在课堂上创建的私有stoaryboard和我正在使用的代码如下语法将其分配给框架元素。

I haven't define storyboard in .xaml file. But when code behind design file(.xaml) I have created private stoaryboard in class and i am assigning it to framework element using following syntax in code.

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

其中storyboard1是我在课堂上和viewbox1已创建的对象元素,我想申请这个动画。

where storyboard1 is object that I have created in class and viewbox1 is element to which I want to apply this animation.

有人能帮助我吗?先谢谢了。

Can anybody help me? Thanks in advance.

推荐答案

我也曾经有过这样的警告,却发现containingElement在开始调用指定的也必须是。在停止通话,这应该消除警告指定

I too had this warning, but found that the 'containingElement' specified in the Begin call must also be specified in the Stop call, which should eliminate the warning.

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

this.storyboard1.Stop(this.viewbox1);

这篇关于System.Windows.Media.Animation警告:6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆