是否可以检查位置服务是否有效?
我的意思是设置>位置>位置服务
可能没有直接的API用于调用,但它可以与GeoCoordinateWatcher一起使用吗?
GeoCoordinateWatcher g = new GeoCoordinateWatcher(); g.Start(); if (g.Permission.Equals(GeoPositionPermission.Granted)) { //Your location services is enabled. Go ahead. //Your codes goes here. } else if (g.Permission.Equals(GeoPositionPermission.Denied) || g.Permission.Equals(GeoPositionPermission.Unknown)) { MessageBox.Show("Location services are disabled. To enable them,Goto Settings - Location - Enable Location Services.","Location services",MessageBoxButton.OK); }