Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

move canvas with animation from left to right problem

$
0
0
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?


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>