ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Core.DeviceLocation Namespace / DeviceLocationService Class / Close Method
Example Version

Close Method (DeviceLocationService)
Closes the current device location source connection. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void Close()
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Example
Close the Current Device Location Source
//Is there a current device source?
var src = DeviceLocationService.Instance.GetSource();
if (src == null)
  return;//no current source

await QueuedTask.Run(() =>
{
  DeviceLocationService.Instance.Close();
});
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also