System.Windows.Media.Animation Warning: 6

耗尽温柔 提交于 2019-12-18 09:16:13

问题


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

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?

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);

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.


回答1:


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);


来源:https://stackoverflow.com/questions/18826395/system-windows-media-animation-warning-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!