WPF drag and drop and data types?

Assuming you control the start of the drag (you're not dragging from another app), it's up to you what the type is. Just make the source and destination code match. In the drag (typically a MouseMove or MouseDown handler).

Assuming you control the start of the drag (you're not dragging from another app), it's up to you what the type is. Just make the source and destination code match. In the drag (typically a MouseMove or MouseDown handler): var dragData = new DataObject(typeof(JobViewModel), job); DragDrop.

DoDragDrop(element, dragData, DragDropEffects. Move); Begins the drag. And then in the drop (it sounds like you've gotten this far): var dataObj = e.

Data as DataObject; var dragged = dataObj. GetData(typeof(JobViewModel)) as JobViewModel; You can also use a String instead of a Type.

Just set the control's AllowDrop property to true. And implement the Drop event on it; you can access the drop information in the event argument. For the GetData part, you can use this to get specific data types.

Here is the file drop for example: string fileNames = (string)e.Data. GetData(DataFormats. FileDrop, true); Thanks.

I have gone as far as this! :) my problem is how to get the data type in OnDrop(DragEventArgs e)... using getData? With what type?

If I use the type of my object I get null... Thanks for your help! – geo Apr 20 at 8:30 I have updated my answer, hope it helps. – Howard Apr 20 at 8:43.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions