void MapControl_MouseUp(object sender, MouseButtonEventArgs e) { if (e.ChangedButton == MouseButton.Middle) { if (ViewerToolManager.OverlayTools.Any(x => x is PanCanvasTool)) { ViewerToolManager.RemoveTool(ViewerToolManager.OverlayTools.First(x => x is PanCanvasTool)); } } }
void MapControl_MouseDown(object sender, MouseButtonEventArgs e) { if (e.ChangedButton == MouseButton.Middle) { if (!(ViewerToolManager.ExclusiveTool is PanCanvasTool)) { PanCanvasTool pct = new PanCanvasTool(); pct.StartDrag(e.GetPosition(MapControl.Current)); ViewerToolManager.AddTool(pct); } } }