Windows Phone 8检查位置是否已打开/关闭?

Rar*_*can 4 location windows-phone-8

我想检查位置服务是否已打开或关闭,因此我可以通知用户他需要打开它以便在地图上查看他的位置.还想检查飞行模式是否打开/关闭以及是否打开/关闭WiFi.有什么建议?

and*_*ubi 19

位置:

Geolocator locator = new Geolocator();
if (locator.LocationStatus == PositionStatus.Disabled)
{
    // Location is turned off
}
Run Code Online (Sandbox Code Playgroud)

对于网络资料,请参阅DeviceNetworkInformation课程.例如

bool isWifiOn = DeviceNetworkInformation.IsWiFiEnabled;
Run Code Online (Sandbox Code Playgroud)

另请参阅:如何检测Windows Phone的网络更改