Drag and drop operations with the Surface SDK 2.0

When you develop app targeting the Surface SDK 2.0 sooner or later you will have the need add your logic in drag and drop events:

  1. Drag and drop items from ScatterView to another control
  2. Drop items on the ScatterView
  3. If you have a library container in a ScatterView going around the PixelSense surface you could want that only items belonging to that container can be dropped in.
  4. Same scenario as before, you could what to give visual feedback to the user when an item is placed upon a drop target advising him if the drop operation can be done by adorning the dragged item with a green frame or red if it can’t be done.
  5. Handle all the drag drop operation from start to finish

To Drag and drop items from ScatterView to another control there are two approach described in these two articles:

To Drop items on the ScatterView you can refer to the DragDropSacatterView that can be foud in the Surface SDK 2.0 Samples

If you want that only items belonging to that container can be dropped in you can refer to Custom Hit Testing During a Drag-and-Drop Operation

If you what to give visual feedback to the user when an item is placed upon a drop target you can refer to Creating Visual Cues During a Drag-and-Drop Operation article

If you want to handle all the drag drop operation from start to finish you can refer to Dragging and Dropping Items Between SurfaceListBox Controls

 

Ultimi Post

Discalmer

Articles and content of this blog aren't and shouldn't be interpreted as professional advice or opinions. Author writes on a personal basis and as part of their own research, experimentation and knowledge. Opinions expressed aren't in any way attributable to professional affiliations / institutional thereof or to opinions that the author express as part of their roles / positions that may be quite different from that reported here.