Bing地图 - 后退按钮 - 无法返回我的应用WP8

时间:2014-01-29 13:56:57

标签: windows-phone-8 bing-maps

当我按下后退按钮关闭bing maps应用程序并返回应用程序时,bing地图一次又一次地打开,无法关闭它们。如何解决这个问题?(我在Windows Phone 8上)

 protected override  void OnNavigatedTo(NavigationEventArgs e)
    {
        base.OnNavigatedTo(e);

        if (NavigationContext.QueryString.TryGetValue("itineraire", out itineraire))
        {

            // You can specify a label and a geocoordinate for the end point.
            GeoCoordinate spaceNeedleLocation = App.Sitegeolocalisation;
            LabeledMapLocation spaceNeedleLML = new LabeledMapLocation(App.leSite.SiteName, spaceNeedleLocation);

            // If you set the geocoordinate parameter to null, the label parameter is used as a search term.
            MapsDirectionsTask mapsDirectionsTask = new MapsDirectionsTask();

            mapsDirectionsTask.End = spaceNeedleLML;

            // If mapsDirectionsTask.Start is not set, the user's current location is used as the start point.

            mapsDirectionsTask.Show();


        }
        else
        {
            MapsTask mapsTask = new MapsTask();

            mapsTask.ZoomLevel = 17;
            //Omit the Center property to use the user's current location.
            mapsTask.Center = App.Sitegeolocalisation;

            mapsTask.Show();


        }
    }

1 个答案:

答案 0 :(得分:1)

您可以在NavigationMode中测试属性NavigationEventArgs,如果NavigationMode为Back,则只需跳过您在OnNavigatedTo方法上的代码。