Drag treeview item to canvas in silverlight -


in application, allow user drag item treeview canvas generate control dragged item. have tried use paneldragdroptarget that, canvas couldn't listen drop event.

in xaml file:

<toolkit:paneldragdroptarget allowdrop="true" drop="drop_event">     <canvas name="mycanvas" /> </toolkit:paneldragdroptarget> 

in xaml.cs file:

void drop_event(object sender, dropeventargs e) {     messagebox.show("dropped"); } 

what correct way that? many thanks.

problem solved.

i created class inherit dragdroptarget , wrap canvas in it.

    public class canvasdragdrop : dragdroptarget<panel, uielement>     {         //override methods if needed     } 

in xaml file

    <canvasdragdrop allowdrop="true">         <canvas x:name="mycanvas" />     </canvasdragdrop> 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -