2013-05-07 118 views
0

如何使用窗口手機API顯示位置設置的鏈接。我能夠顯示啓用Wifi的鏈接,但無法找到任何地方如何顯示位置設置Windows Phone的位置設置

回答

0

你不能這樣做..因爲位置設置是特定於每個應用程序。這也是MS的實施方式。否則你的應用程序將被拒絕。因此,您的應用程序應該有一個設置選項,用戶可以在其中禁用並啓用應用程序的位置訪問權限。但在訪問位置時,您還必須考慮「電話位置」訪問設置。

GeoCoordinateWatcher g = new GeoCoordinateWatcher(); 
      g.Start(); 
      if (g.Permission.Equals(GeoPositionPermission.Granted)) 
      { 
       // Check application level access and proceed 
      } 
      else if (g.Permission.Equals(GeoPositionPermission.Denied) || g.Permission.Equals(GeoPositionPermission.Unknown)) 
      { 
       // Your code/message to the user notifying about location access being disabled at the device level 
      }