I want to move animate an rectangle object to move it in x-axis. I am new to WPF animation, started out with the following:
You can't animate Margin.Left (because Left
is not a dependency property), but you can animate Margin
. Use ObjectAnimationUsingKeyFrames:
134,70,0,0
50,70,0,0
There are some alternatives that allow you to use a DoubleAnimation
, rather than key frames:
Canvas.Left
.TranslateTransform.X
.