Ejemplo n.º 1
0
        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;
                }
            }
        }
Ejemplo n.º 2
0
        public void OnMarkerDragStart(Marker marker)
        {
            var mAnnotation = (marker.Tag as AnnotationTag).Annotation;

            if (mAnnotation is IBindingMapAnnotation anno)
            {
                anno.Location = marker.Position.ToBinding2DLocation();
                if (MarkerDragStart?.CanExecute(anno) ?? false)
                {
                    MarkerDragStart.Execute(anno);
                }
            }
        }