Exemple #1
0
 private void Locator_OnStatusChanged(
     Windows.Devices.Geolocation.Geolocator sender,
     Windows.Devices.Geolocation.StatusChangedEventArgs args)
 {
     this.LocationStatus = args.Status.ToLocalPositionStatus();
     this.StatusChanged?.Invoke(this, new StatusChangedEventArgs(this.LocationStatus));
 }
Exemple #2
0
        void geolocator_StatusChanged(Windows.Devices.Geolocation.Geolocator sender, Windows.Devices.Geolocation.StatusChangedEventArgs args)
        {
            if (this.IsListening)
            {
                switch (args.Status)
                {
                case Windows.Devices.Geolocation.PositionStatus.Disabled:
                case Windows.Devices.Geolocation.PositionStatus.Initializing:
                    break;

                case Windows.Devices.Geolocation.PositionStatus.NoData:
                case Windows.Devices.Geolocation.PositionStatus.NotAvailable:
                    this.PositionError(sender, new PositionErrorEventArgs(GeolocationError.PositionUnavailable));
                    break;

                case Windows.Devices.Geolocation.PositionStatus.NotInitialized:
                    this.PositionError(sender, new PositionErrorEventArgs(GeolocationError.Unauthorized));
                    break;

                case Windows.Devices.Geolocation.PositionStatus.Ready:
                    break;
                }
            }
        }
Exemple #3
0
 private void _locator_StatusChanged(Windows.Devices.Geolocation.Geolocator sender, Windows.Devices.Geolocation.StatusChangedEventArgs args)
 {
     StatusChanged?.Invoke(this, new StatusChangedEventArgs((PositionStatus)((int)args.Status)));
 }