If there is no current DeviceLocationSource the property will return false.
{
bool enabled = MapDeviceLocationService.Instance.IsDeviceLocationEnabled;
await QueuedTask.Run(() =>
{
MapDeviceLocationService.Instance.SetDeviceLocationEnabled(!enabled);
});
}
{
//Checks if the current device location source is enabled on the map
if (MapDeviceLocationService.Instance.IsDeviceLocationEnabled)
{
//The Device Location Source is Enabled
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)