GeoCoordinateWatcher.TryStart Method (Boolean, TimeSpan)

.NET Framework (current version)

Initiates the acquisition of data from the current location provider. This method returns synchronously.

Namespace:   System.Device.Location
Assembly:  System.Device (in System.Device.dll)

abstract TryStart : 
        suppressPermissionPrompt:bool *
        timeout:TimeSpan -> bool
override TryStart : 
        suppressPermissionPrompt:bool *
        timeout:TimeSpan -> bool


Type: System.Boolean

true to suppress the permission dialog box; false to display the permission dialog box.

Type: System.TimeSpan

Time in milliseconds to wait for the location provider to start before timing out.

Return Value

Type: System.Boolean

true if data acquisition is started within the time period specified by timeout; otherwise, false.

This method blocks execution of the calling thread during the time period specified by timeout. Use caution when calling TryStart from the user interface thread of your application.

The following example demonstrates how to call TryStart.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 4.0
Windows Phone Silverlight
Available since 7.0
Return to top