Windows Dev Center

Geolocator.StatusChanged | statuschanged event

Raised when the ability of the Geolocator to provide updated location changes.

Syntax


public:
event TypedEventHandler<Geolocator, StatusChangedEventArgs>^ StatusChanged {
   Windows::Foundation::EventRegistrationToken add(TypedEventHandler<Geolocator, StatusChangedEventArgs>^ value);
   void remove(Windows::Foundation::EventRegistrationToken token);
}

Event information

Delegate TypedEventHandler<Geolocator, StatusChangedEventArgs>

Remarks

You can access information about the event with the StatusChangedEventArgs object that is passed to your event handler.

The GetGeopositionAsync method times out after 60 seconds, except when in Connected Standby. During Connected Standby, Geolocator objects can be instantiated but the Geolocator object will not find any sensors to aggregate and calls to GetGeopositionAsync will time out after 7 seconds. Upon time out, the StatusChanged event listeners will be called once with the NoData status, and the PositionChanged event listeners will never be called.

When using a geofence, use the GeofenceMonitor's StatusChanged event to monitor changes in location permissions instead of the StatusChanged event from the Geolocator class. A GeofenceMonitorStatus of Disabled is equivalent to a disabled PositionStatus - both indicate that the app does not have permission to access location.

Important  

Starting in Windows 10 Insider Preview, call the RequestAccessAsync before accessing the user’s location. At that time, your app must be in the foreground and RequestAccessAsync must be called from the UI thread. Until the user grants your app permission to their location, your app can't access location data.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Devices.Geolocation
Windows::Devices::Geolocation [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Capabilities

location
ID_CAP_LOCATION [Windows Phone]

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8

Namespace

Windows.Devices.Geolocation
Windows::Devices::Geolocation [C++]

Metadata

Windows.winmd

Capabilities

location
ID_CAP_LOCATION [Windows Phone]

See also

Detect a user's location
Respond to location updates
Set up a geofence
Geolocator
StatusChangedEventArgs
geolocation sample

 

 

Show:
© 2015 Microsoft