static async void OnLocatorStatusChanged(Geolocator sender, StatusChangedEventArgs args) { switch (args.Status) { case PositionStatus.NoData: await StopTracking(); await Thread.Pool.Run(() => PositionError.Raise(new Exception(UNAVAILABLE_ERROR))); return; case PositionStatus.Disabled: await StopTracking(); await Thread.Pool.Run(() => PositionError.Raise(new Exception(UNAUTHORISED_ERROR))); return; default: return; } }
static Task OnListenerPositionError(Exception error) => StopTracking().ContinueWith(x => PositionError.Raise(error));