This is simple enough. For a image control's parent, use the instance of the class
System.Windows.Controls.Canvas
. Handle the events
MouseDown
,
MouseUp
and
MouseMove
of the instance of your moving control. For modification of location, use the modification of an
attached property of the instance of the canvas for your moving object. This is as simple as using the methods
Canvas.SetLeft(UIElement element, double length)
,
Canvas.SetTop(UIElement element, double length)
and the like, where
element
is your control you want to move:
http://msdn.microsoft.com/en-us/library/system.windows.controls.canvas.aspx[
^].
Everything else is just pure logic of your code.
See also this overview on attached properties, to understand how it works:
http://msdn.microsoft.com/en-us/library/ms749011.aspx[
^].
—SA