I have an image in a Canvas
, but when I use DoubleAnimation
to move it and then use Canvas.SetLeft(image)
, the method is ignored, the only way to move it again is with animations. What's wrong with Canvas.SetLeft(control)
?
Here is an explanation with images of what's happening:
The default coin position is 0 in Canvas.Left
property.
I move it with the mouse with the next code;
Point p = Mouse.GetPosition(cCoinContainer);
Canvas.SetLeft(iCoin, p.X);
And when the mouse left the Canvas, the animation moves the coin to it's original Canvas.Left
position.
The problem is when I do it again (move the coin with the mouse with Canvas.SetLeft(iCoin, p.X);
it's completely ignored, only works with animations.