且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

双动画或更新依赖项属性后,椭圆位置不会更改。

更新时间:2023-10-08 13:19:04

我无法设置更新与 Ellipse 。



如果我看到类似

I cannot set where do you update the properties related to the position of Ellipse.

I would agree that you do if I saw something like
myCanvas.SetLeft(MyEllipse, displacementX);
myCanvas.SetTop(MyEllipse, displacementY);





请参阅:

http://msdn.microsoft.com/en-us/library/system.windows .controls.canvas.settop.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/system.windows.controls.canvas.setleft.aspx [ ^ ]。



现在关于动画。我无法看到你在哪里设置 UIElement Canvas 的位置。你可以使用 TranslateTransform ,这是一种正确的方法,但你不应该期望你的任何依赖属性 UIElement 已更新。这些只是不同的事情。



-SA



Please see:
http://msdn.microsoft.com/en-us/library/system.windows.controls.canvas.settop.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.controls.canvas.setleft.aspx[^].

Now about the animation. I cannot see where you animate the position of a UIElement of Canvas. You do it to the TranslateTransform, which is a right approach, but you should not expect that any dependency property of you UIElement are updated. These are just different things.

—SA