Drag and drop using AutoCAD .NET API from WPF controls in a palette

Drag and drop using AutoCAD .NET API from WPF controls in a palette

Anonymous
Not applicable
669 Views
0 Replies
Message 1 of 1

Drag and drop using AutoCAD .NET API from WPF controls in a palette

Anonymous
Not applicable

Hello All,

 

This is probably a newbie question, but I am unable to find a suitable answer by a google search. I am trying to do a following:

 

I have a palette that contains a WPF listview control. When an item is selected, dragged, and dropped onto the AutoCAD 2015 canvas, it is supposed to transfer a block definition from a DWG file on the drive and drop on the canvas. I have attempted to implement the behavior using the following event handlers:

 

wpfListView_PreviewMouseLeftButtonDown

wpfListView_PreviewMouseMove

wpfListView_PreviewMouseLeftButtonUp

 

The bulk of the transfer and drop operation is coded in the ...LeftButtonUp() handler.

 

It seems to do the job somewhat but it is moderately unstable. The drop fails some times and the user have to repeat the drag-and-drop for it to work. I did implement a drag-and-drop using Windows Form TreeView control by using only the TV control's item.drag() event handler but since we migrated to WPF controls it has a become a problem in selecting which event handler to choose from to get the same effect.

 

I was wondering whether there is another way to do this more consistently using some other event handlers. Some pointers would be really appreciated.

 

Thanks a lot in advance.

 

Mahbubur Rashid.

0 Likes
670 Views
0 Replies
Replies (0)