ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping.DeviceLocation Namespace / MapDeviceLocationService Class / IsDeviceLocationEnabled Property
Example Version

IsDeviceLocationEnabled Property (MapDeviceLocationService)
Determines the enabled state of the current DeviceLocationSource.
Syntax
public bool IsDeviceLocationEnabled {get;}
Remarks
If there is no active map view the property will return false.

If there is no current DeviceLocationSource the property will return false.

Example
Enable/Disable Current Device Location Source For the Map
bool enabled = MapDeviceLocationService.Instance.IsDeviceLocationEnabled;

await QueuedTask.Run(() =>
{
  MapDeviceLocationService.Instance.SetDeviceLocationEnabled(!enabled);
});
Check if The Current Device Location Is Enabled On The Map
if (MapDeviceLocationService.Instance.IsDeviceLocationEnabled)
{
  //The Device Location Source is Enabled
}
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also