views:

17

answers:

0

Hi there, I'm implementing a WPF application where one can drag & drop a element in a designated area where this element is restored to its initial position. The drag & drop is working, and already have the events for the dragging and drop actions; my problem is how to restore the visual element to the correct position, previously stored (of course).

The elements are within a Grid, and it looks like this is preventing me of using the Canvas.GetLeft() and Canvas.SetLeft() methods, and because of that I've saved the initial Margin property as the origin for the object. The problem resides in the fact if I, set the margin to the origin in the drop event, it won't work.

If someone know how to do this please let me know.

Note: the reason for the fact that I'm using the grid is because the application has a fullscreen function and I want the elements to be rearranged in the same position in fullscreen or window modes.