I managed to solve my problem and here is a brief explanation on how I did it:
I searched and found this. I then used this SurfaceListBox
with these drag and drop events and combined it with the DragDropScatterView
class, so each time a new ScatterViewItem
was created I would have a normal ScatterView
control of my custom object. With this method you also have to create a Visual Cursor, i.e., what you'll see when you'e dragging the item from the SurfaceListBox
.
The thing that was puzzling me and that Serge Calderara (from the MSDN Surface Forum) helped me with, was that I kept trying to associate these drag and drop events to a Label
for example, or a UserControl
even, but I was looking at things the wrong way. In most cases the best solution for you is to have a container, and in that container you put the UserControls
you want and you only associate the drag and drop events to that container, and not to each individual item. With that in mind it was rather easy to put things together, I created my UserControls
and populated the SurfaceListBox
(wich is my container) with an ItemTemplateSelector
and I used that same Selector for the ScatterView
(that's receiving the items from the container). In my object class I just defined a variable to save which type of UserControl
I'll have and return the DataTemplate
accordingly.
With this I created a SurfaceListBox
with two custom UserControls that I can drag and drop to a ScatterView
and back. A working sample with MVVM pattern can be found here: http://sdrv.ms/10SjKaH.
I hope it can help others and it helped me. If you have any questions or suggestions please feel free to ask/tell.