Mouse cursor position while dragging

1 posts, 0 answers
  1. MuxMux
    MuxMux avatar
    4 posts
    Member since:
    Oct 2011

    Posted 15 Oct 2013 Link to this post


    so the problem is to adjust mouse cursor position while dragging an item from TreeListView control.
    I looked through the forum topics but nothing helped. I am using OnDragInitialize event handler 
    where I set the DragVisualOffset and DragVisual properties of DragInitializeEventArgs object:
    private void OnDragInitialize(object sender, DragInitializeEventArgs e)
       recipesDragDropBehavior.DraggedItems = GetDraggedItems(e.Data);
       e.DragVisual = new DragVisual()
          ContentTemplate = Resources["dragComponentTooltipTemplate"] as DataTemplate,
          Content = recipesDragDropBehavior
       var p = new Point
          X = e.RelativeStartPoint.X + 30,
          Y = e.RelativeStartPoint.Y + 30
       e.DragVisualOffset = p;
    Unfortunately, this does not work.
    Any solutions are appreciated.

    Thanks in advance.
Back to Top