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

This blog post will guide you through several effective methods to troubleshoot and resolve the issue of Microsoft Edge not...
Windows 11 offers a range of audio enhancements that can enrich your listening experience. These enhancements include features like virtual...
Windows 11 brings a fresh and visually stunning design to your desktop, and one of the standout features is the...