简体   繁体   中英

Where is the Shape located on Canvas?

Say I put a Shape on a Canvas like this:

Canvas.SetLeft(myShape, 50);
Canvas.SetTop(myShape, 30);
canvas.Children.Add(myShape);

After that, myShape was drag & dropped on this Canvas.

How can I determine the current myShape coordinates ?

For example, before the drag & drop I would like to get (50,30). Thanks !

var left = Canvas.GetLeft(myShape);
var top = Canvas.GetTop(myShape);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM