In Windows Phone , you could use the BingMapsDirectionsTask to get the driving direction from one location to another location.
The BingMapsDirectionsTask will launch the Map application where you could view the directions based on the specified location.
How to get Driving Directions in Windows Phone ?
Below is a sample program to demonstrate How to get Driving Directions in Windows Phone using BingMapsDirectionsTask .
private void button1_Click(object sender, RoutedEventArgs e) { BingMapsDirectionsTask bingMapDirection = new BingMapsDirectionsTask(); bingMapDirection.Start = new LabeledMapLocation("Bangalore", null); bingMapDirection.End = new LabeledMapLocation("Mysore", null); bingMapDirection.Show(); }
It is necessary to specify the start or the end property of the BingMapsDirectionsTask . If both the Start and End property is empty , then you will receive the InvalidOperationException was unhandled. Start and End cannot both be invalid.