locked
Drag-and-drop Between Metro Apps RRS feed

  • Question

  • Hi,

    I'm planning a Metro-style app, and checking out feasibility for some of the planned features. So far so good, but there is one thorn in my side. I'd like to be able to drag content from one app to another (in Snap mode). In particular, I would like to drag data from a Metro app into the desktop. My background is in web development, so I've started with building a Metro App in JavaScript, and although I am able to drag content from one part of the app to another using 'draggable="true"', the same does not work into the desktop.

    I can get close - when I drag near the snap boundary, the content partially appears in the desktop app, but it disappears again as soon as I cross the border, and the cursor remains in the "nodrop" form.

    So, given that my initial attempts have failed - are there any other solutions? Is there another way of dragging content from a JavaScript app, perhaps using a Windows Runtime/Class Library? If it's not possible at all in JavaScript, does anyone know if I'm more likely to have some luck in a lower-level language?

    Thanks,

    Chris

    Sunday, August 5, 2012 7:19 PM

Answers

  • Hi Chris,

    There is no way to drag between apps. The only interaction is via the contracts.

    --Rob

    • Marked as answer by Hephistocles Monday, August 6, 2012 8:52 AM
    Sunday, August 5, 2012 7:22 PM
    Moderator

All replies

  • Hi Chris,

    There is no way to drag between apps. The only interaction is via the contracts.

    --Rob

    • Marked as answer by Hephistocles Monday, August 6, 2012 8:52 AM
    Sunday, August 5, 2012 7:22 PM
    Moderator
  • That's a shame; thanks anyway.

    Chris

    Monday, August 6, 2012 8:52 AM
  • Would it not be possible to provide an Inter-App drag+drop API which is based on the sharing contract API?

    Drag+drop between apps is basically the same as sharing data, therefore it should be possible to extend the Sharing Contract API so that it works with drag+drop.

    For example, when a drag event is initiated by the source app, then the Share Contract API can determine whether the target app in the second pane is able to receive this shared data on the drop event.

    Please can you suggest this to the development team!

    Thanks.

    Sunday, August 19, 2012 3:43 PM
  • I have bad news to you.

    draggable="true" does not work for touch inputs, just for mouse.

    Thursday, August 23, 2012 11:39 AM
  • Hi Rob,

    Would it not be possible to provide an Inter-App drag+drop API which is based on the sharing contract API?

    Drag+drop between apps is basically the same as sharing data, therefore it should be possible to extend the Sharing Contract API so that it works with drag+drop.

    For example, when a drag event is initiated by the source app, then the Share Contract API can determine whether the target app in the second pane is able to receive this shared data on the drop event.

    Please can you suggest this to the MS development team!

    Thanks.

    Thursday, August 23, 2012 10:54 PM
  • Hello,

    I don't know what Microsoft will do, or if they plan to do something like this. I think that drag and drop functionality would nicely complement the dragging style of metro style apps (oops, sorry, I meant Windows Store Apps).

    However, the very nature of drag and drop is rooted in the messy window model that Windows Store Apps do not follow; drag and drop in Windows Store Apps is only conceptually possible because of app snapping (Which not all screens support), and multiple monitors, otherwise there is no obvious way to drag and drop between apps, except maybe dragging to the left edge (Like dragging on a button on today's taskbar).

    But I do think Microsoft should build this into the share contract, if even nothing more than a shortcut to the existing contract. Just my 2 cents.

    Sunday, September 30, 2012 10:22 PM