public override void ChangedDragState(MKMapView mapView, MKAnnotationView annotationView, MKAnnotationViewDragState newState, MKAnnotationViewDragState oldState) { if (annotationView.Annotation is BindingMKAnnotation annotation) { switch (newState) { case MKAnnotationViewDragState.Starting: if (MarkerDragStart?.CanExecute(annotation.Annotation) ?? false) { MarkerDragStart.Execute(annotation.Annotation); } break; case MKAnnotationViewDragState.Ending: if (MarkerDragEnd?.CanExecute(annotation.Annotation) ?? false) { MarkerDragEnd.Execute(annotation.Annotation); } break; case MKAnnotationViewDragState.Dragging: if (MarkerDrag?.CanExecute(annotation.Annotation) ?? false) { MarkerDrag.Execute(annotation.Annotation); } break; } } }
public void OnMarkerDragEnd(Marker marker) { var mAnnotation = (marker.Tag as AnnotationTag).Annotation; if (mAnnotation is IBindingMapAnnotation anno) { anno.Location = marker.Position.ToBinding2DLocation(); if (MarkerDragEnd?.CanExecute(anno) ?? false) { MarkerDragEnd.Execute(anno); } } }