I was able to drag a Pushpin by adding an event handler for MouseMove and updating the Pushpin to the location of the mouse.
<my:Pushpin x:Name="pushpin" MouseLeftButtonDown="pushpin_MouseLeftButtonDown" MouseLeftButtonUp="pushpin_MouseLeftButtonUp" MouseMove="pushpin_MouseMove"/>
But the problem is the Map Control will also pan at the same time you are dragging the Pushpin. To solve that I had to add an event handler for mouse up and mouse down to the Pushpin and one for MapPan for the Map Control.
private void mapControl_MapPan( object sender, MapDragEventArgs e )
{
if( isDragging )
{
e.Handled = true;
}
}
private void pushpin_MouseLeftButtonDown( object sender, MouseButtonEventArgs e )
{
pushpin.CaptureMouse( );
isDragging = true;
}
private void pushpin_MouseLeftButtonUp( object sender, MouseButtonEventArgs e )
{
pushpin.ReleaseMouseCapture( );
isDragging = false;
}
private void pushpin_MouseMove( object sender, MouseEventArgs e )
{
pushpin.Location = mapControl.ViewportPointToLocation( e.GetPosition( mapControl) );
}
That will prevent the map from panning while the Pushpin is being dragged.