Currently i am using the following code to display locations on a map in my application:
//Bustop 8448 –
Pushpin BusStop8448 = new Pushpin();
BusStop8448.Background = new SolidColorBrush(Colors.Red);
BusStop8448.Location = new GeoCoordinate(-36.934608, 174.73016);
BusStop8448.Content = "Bus Stop: 8448 ";
BusStop8448.MouseLeftButtonUp += new MouseButtonEventHandler(BusStop8448_MouseLeftButtonUp);
var BusStop8448Press = sender as Pushpin;
this.Map.Children.Add(BusStop8448);
This is very tedious as there are hundreds of locations to add, so I was thinking about displaying locations based on a KML file.
My question is how do I display pushpins based on a KML file in windows phone 7 Bing Maps?
Also, I would like to know if there is a way of having an Onclick event for each of these pushpins from the KML file.
Currently I am using the below code which works file, but I 'm not sure how I would implemented that with KML based pushpins
void BusStop8679_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
int id = 8679;
NavigationService.Navigate(new Uri("/DepartureBoard.xaml?ListingId=" + id, UriKind.Relative));
}