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)); }
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; } } }
private void _locator_StatusChanged(Windows.Devices.Geolocation.Geolocator sender, Windows.Devices.Geolocation.StatusChangedEventArgs args) { StatusChanged?.Invoke(this, new StatusChangedEventArgs((PositionStatus)((int)args.Status))); }