public void StopTracking() { if (!IsTracking) return; CurrentLocation.IsEnabled = false; CurrentLocation.IsResolved = false; _geolocator.PositionError -= OnListeningError; _geolocator.PositionChanged -= OnPositionChanged; _geolocator.StopListening(); IsTracking = false; _geolocator = null; }
private void Setup() { if (_geolocator != null) return; _geolocator = new Geolocator {DesiredAccuracy = 10}; _geolocator.PositionError += OnListeningError; _geolocator.PositionChanged += OnPositionChanged; }