Beispiel #1
0
        private void OnDidSelectAnnotationView(object sender, MKAnnotationViewEventArgs e)
        {
            var customView = (IdAnnot)e.View;

            _infoView = new IdView {
                id = customView.TripId
            };

            var trip = MapUtil.GetDefaultTripFile().GetTripWithTripId(customView.TripId);

            if (trip == null)
            {
                Console.WriteLine("Error! Trip not found.");
                return;
            }

            _infoView.Frame = new CGRect(0, -40, 300, 100);
            var label = new UILabel(new CGRect(0, -40, 300, 100))
            {
                Text = trip.Route.Name + " (" + trip.ListStopTimeRangeAsString() + ")"
            };

            _infoView.AddSubview(label);
            _infoView.Center = new CGPoint(0, 0);
            e.View.AddSubview(_infoView);
        }