Windows Phone 8 Check if location is turned on or off?

I want to check if the location service is enabled or not, so I can tell the user that he needs to enable it in order to see his location on the map. Also want to check if airplane mode is on and WiFi is on. Any suggestions?

+4
source share
1 answer

For location:

Geolocator locator = new Geolocator(); if (locator.LocationStatus == PositionStatus.Disabled) { // Location is turned off } 

For network materials, see the DeviceNetworkInformation class . For instance.

 bool isWifiOn = DeviceNetworkInformation.IsWiFiEnabled; 

See also: How to detect network changes for Windows Phone

+19
source

Source: https://habr.com/ru/post/1482108/


All Articles