Drag drop library

Some time back Marcelo had written a series of posts covering drag and drop. This was interesting reading and I had uploaded the C# code in one of my previous posts. Recently, I came across Pavans blog where he shows the same using attached properties. The code is written with reusability and ease of use in mind.

To use the code you would need to specify the source and the destination (putting it in layman terms)

<

local:CanvasDragDropAdvisor x:Key="advisor"/>

<Canvas Background="White" local:DragDropManager.DragSourceAdvisor="{StaticResource advisor}"
local:DragDropManager.DropTargetAdvisor="{StaticResource advisor}">

You would need to implement the SourceAdvisor and TargetAdvisor (in the above example theres only one as the source and target is the same canvas). The implementation is more or less the same as in the samples provided with the library.

There were some minor glitches in the original code (such as adorner position relative to mouse) which I have fixed in the current code. Thanks to Pavan for some kewl code :)

DragDrop.zip