How to get Driving Directions in Windows Phone ?

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();
}
How to get Driving Directions in Windows Phone ? - 2
How to get Driving Directions in Windows Phone ? – 2

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.

How to get Driving Directions in Windows Phone ?
How to get Driving Directions in Windows Phone ?

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...