This project has moved and is read-only. For the latest updates, please go here.

MapItemsControl with DragItemsStarting event

Jun 19, 2014 at 4:26 PM

I need my MapItems in a MapItemsControl to be sources of drag and drop operations. Currently MapItemsControl does not fire the DragItemsStarting event as it inherits from ListBox. So I was wondering if it would be possible to inherit from ListView instead which would offer this event?
Have you by any chance tried this or do you know of any other possibility?
I know MapItemsControl can be a drop target so wouldn't it make sense to make it a drag source as well? I am using the MapControl for WinRT by the way.

Thanks for your help! Regards, blomquist
Jun 19, 2014 at 4:44 PM
You've got the code, so why not try it yourself?
Jun 24, 2014 at 1:32 PM
You are absolutely right, so to answer my own question: I changed MapItemsControl to derive from ListView instead of ListBox and MapItem to derive from ListViewItem instead of ListBoxItem. Now the MapItemsControl has the property "CanDragItems" and the event "DragItemsStarting" which enables drag and drop functionality.
The only downside so far is that it only compiles for WinRT, not for Silverlight/WPF (which I don't need anyway) plus I have to maintain my own derivative of the MapControl.

Kind regards, blomquist