/// <summary> /// Drag handler. Element is being dragged. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> protected void DragMove(Object sender, DragDropEventArgs args) { var o = args.AnchorPosition - args.HitPosition; var p = layer.Map.PointFromScreen(args.Position); Point = layer.ToWorld(p + o); }
/// <summary> /// Inserts a new via way point and attaches a Drag&Drop operation to it. /// </summary> /// <param name="style">Display style of the way point</param> /// <param name="initialPosition">Initial position</param> /// <param name="position">Current position</param> public void BeginDragVia(ShapeStyle style, Point initialPosition, Point?position = null) { // the via location in world coordinates var pointOnMap = layer.ToWorld(layer.Map.PointFromScreen(initialPosition)); // insert the via way point then attach the drag and drop operation to it. InsertVia(pointOnMap, style).BeginDrag(initialPosition, position); }