Dim AnimationDefinitionLeft As New Animation.DoubleAnimation(-100, 100, New Duration(TimeSpan.FromMilliseconds(Duration)), Animation.FillBehavior.Stop) Dim ID3 As String = CreateNewID() NewElement.RegisterName(ID3, CurrentElement) System.Windows.Media.Animation.Storyboard.SetTargetName(AnimationDefinitionLeft, ID3) System.Windows.Media.Animation.Storyboard.SetTargetProperty(AnimationDefinitionLeft, New PropertyPath(Canvas.LeftProperty)) StoryBoardAnimator.Children.Add(AnimationDefinitionLeft)
When using this code to move a canvas from left to right it does not work.
I get a warning 6,
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='Remove'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='1453241'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='System.Windows.Controls.Canvas'; TargetElement.HashCode='59582920'; TargetElement.Type='System.Windows.Controls.Canvas'
What am I doing wrong here?