This is a migrated thread and some comments may be shown as answers.

Mouse cursor position while dragging

0 Answers 39 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
MuxMux
Top achievements
Rank 1
MuxMux asked on 15 Oct 2013, 08:56 AM
Hello,

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.
Mikhail.

No answers yet. Maybe you can help?

Tags
DragAndDrop
Asked by
MuxMux
Top achievements
Rank 1
Share this question
or