Share via

StatusChangedEventArgs Class


Provides information for the StatusChanged event.

public ref class StatusChangedEventArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class StatusChangedEventArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class StatusChangedEventArgs
Public NotInheritable Class StatusChangedEventArgs
Object Platform::Object IInspectable StatusChangedEventArgs

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)
App capabilities
location ID_CAP_LOCATION [Windows Phone]


This code example demonstrates how the StatusChanged event is handled. The Geolocator object triggers the StatusChanged event to indicate that the user's location settings changed. That event passes the corresponding status via the argument's Status property (of type PositionStatus). Note that this method is not called from the UI thread and the Dispatcher object invokes the UI changes. For more info, see Get current location.

using Windows.UI.Core;
async private void OnStatusChanged(Geolocator sender, StatusChangedEventArgs e)
    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
        // Show the location setting message only if status is disabled.
        LocationDisabledMessage.Visibility = Visibility.Collapsed;

        switch (e.Status)
            case PositionStatus.Ready:
                // Location platform is providing valid data.

                // notify user: Location platform is ready

            case PositionStatus.Initializing:
                // Location platform is attempting to acquire a fix. 

                // notify user: Location platform is attempting to obtain a position

            case PositionStatus.NoData:
                // Location platform could not obtain location data.

                // notify user: Not able to determine the location

            case PositionStatus.Disabled:
                // The permission to access location data is denied by the user or other policies.

                // notify user: Access to location is denied

                // Clear cached location data if any

            case PositionStatus.NotInitialized:
                // The location platform is not initialized. This indicates that the application 
                // has not made a request for location data.

                // notify user: No request for location is made yet

            case PositionStatus.NotAvailable:
                // The location platform is not available on this version of the OS.

                // notify user: Location is not available on this version of the OS

                // unknown case


This object is the argument passed to the handler for the StatusChanged event.



The updated status of the Geolocator object.

Applies to

See also