I have one main page with one button that directs my application to another page. When I click the button, the directed page should have gone to the address that I want on the Bing map. But I only see the world map. Here is the code of the second page:
public BingMapPage()
{
InitializeComponent();
BingMap.Mode = new RoadMode();
BingMapsTask bmt = new BingMapsTask();
bmt.SearchTerm = "Paris";
bmt.Show();
}
The code above only show the world map. However, if I write the same code in the constructor of the main page, it works as it is supposed to. Moreover, I tried to create a method in the second page as below:
public void StartSearch()
{
BingMapsTask bmt = new BingMapsTask();
bmt.SearchTerm = "Paris";
bmt.Show();
}
And then created an instance of my second page in the main page and called this method. It worked again.
My question is that is there a way of get these codes
bmt.SearchTerm = "Paris";
bmt.Show();
working outside of mainpage of an Windows Phone 7 application.