Hi,

I did something similar just by directly pressing the annotation by
overriding the DidSelectAnnotationView and loading the view in there.
This approach does not show the callout though.

You could probably implement CalloutAccessoryControlTapped to get the
event of tapping on the button you attach to the Callout. Here you
should be able to the which annotation you have tapped and determine
the view to push from this.

Craig Dunn made a nice example here:
http://conceptdev.blogspot.com/2010/01/monotouch-mapkitdelegate-precated.html

On Fri, Feb 10, 2012 at 2:11 PM, jtorres
<[email protected]> wrote:
> Hi all,
>
> I have a MapView with a great deal of MKAnnotation's object. Actually is a
> custom one. I have a MapViewDelegate for overriding GetViewForAnnotation
> Method and everything is going OK so far.
>
> Inside GetViewForAnnotation method I'm using RightCalloutAccessoryView
> property for adding a button. I want this button, actually detail button, to
> navigate to another View in order to show me an image, however I don't know
> how to do it, since that's my first project w/ Monotouch.
>
> What I'm aim to do is:
>
> public override MKAnnotationView GetViewForAnnotation
>                    (MKMapView mapView, NSObject annotation)
>                {
>                        var anv = mapView.DequeueReusableAnnotation 
> ("thislocation");
>                        if (anv == null) {
>                                anv = new MKPinAnnotationView (annotation, 
> "thislocation");
>                        } else {
>                                anv.Annotation = annotation;
>                        }
>
>                        anv.CanShowCallout = true;
>
>                        UIButton detailButton = 
> UIButton.FromType(UIButtonType.DetailDisclosure);
>                        detailButton.TouchUpInside += /* HERE TO NAVIGATE TO 
> ANOTHER VIEW */
>
>                        anv.RightCalloutAccessoryView = detailButton;
>                        return anv;
>                }
>
> Any idea? Thanks in advance!!
>
> best regards,
>
> --
> View this message in context: 
> http://monotouch.2284126.n4.nabble.com/Understanding-the-Delegates-tp4376197p4376197.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch



-- 
Med Venlig Hilsen / With Best Regards
Tomasz Cielecki
http://ostebaronen.dk
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to