Пример #1
0
 void flyout_sightsListViewItemTapped(object source, Sight s)
 {
     Sight sight = s;
     if (sight.img != "")
     {
         if (sight.img.Length > 3)
         {
             String[] images = sight.img.Split(',');
             mapView.sightFlyout.updateSightInfo(images[0], sight.disc, sight.name);
             mapView.flyout.Hide();
             mapView.sightFlyout.Show();
         }
         else
         {
             mapView.sightFlyout.updateSightInfo(sight.img, sight.disc, sight.name);
             mapView.flyout.Hide();
             mapView.sightFlyout.Show();
         }
     }
     else
     {
         mapView.sightFlyout.updateSightInfo(sight.img, sight.disc, sight.name);
         mapView.flyout.Hide();
         mapView.sightFlyout.Show();
     }
 }
        //public void getDistance(List<Sight> list)
        //{
        //    List<Bing.Maps.Location> locations = new List<Bing.Maps.Location>();
        //    List<Bing.Maps.Location> locations2 = new List<Bing.Maps.Location>();
        //    int i = 0;

        //    foreach (Sight sight in list)
        //    {
        //        if (i < list.Count / 2)
        //            locations.Add(new Bing.Maps.Location(double.Parse(sight.lat), double.Parse(sight.longi)));
        //        else
        //            locations2.Add(new Bing.Maps.Location(double.Parse(sight.lat), double.Parse(sight.longi)));
        //        i++;
        //    }
        //    Double km1 = Convert.ToDouble(mapView.getTotalDistanceKM(locations));
        //    Double km2 = Convert.ToDouble(mapView.getTotalDistanceKM(locations2));
        //    Double km = km1 + km2;

        //    DistanceText.Text = km + "  Km";
        //}

        protected void OnSightsListViewItemTapped(object o, Sight s)
        {
            Sight p = s;
            if (s != null && sightsListViewItemTapped != null)
            {
                sightsListViewItemTapped(this, p);
            }
        }