简体   繁体   中英

Drag and drop between HTML 5 and Silverlight 4

Is it possible to drag an HTML 5 object, eg an <a draggable="true"> , into a Silverlight 4 control and accept it? We've attempted to build a simple prototype using an HTML 5 example and a trivial Silverlight control but the cursor changes to the no-entry sign whenever we hover over the Silverlight control. We do, however, get drag entry events firing in Silverlight.

Our control happily accepts files dragged from the desktop as expected. We think we've got the HTML 5 drag events set up correctly, and I can possibly get our test published somewhere in case that will help. We've successfully implemented dragging inside a Silverlight control but we now need to integrate with non-Silverlight page components.

Is this actually possible to set up or are we just doing something wrong? Thanks for any advice!

Silverlight Drag drop from external sources currently supports only file lists.

You may however be able to get the <object> tag hosting the Silverlight plugin to respond to a dragging. If so you can use the Silveright HTML Bridge to handle these DOM events. Its a bit of a long shot though.

Short answer, as Anthony says is No.

You can emulate the functionality by using the the drag entry event and mouse button up event, then create a silverlight control that most closely matches the HTML one you were dragging, and hide the original html control (which should snap back to its original position)...

Its a little messy, but it works...

Incidently, as far as i'm aware, dragging between 2 silverlight instances on the same page would require a similar technique...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM