public async Task StopListeningLocation(bool stopGeolocator, bool ifDataReset) { LocFlag = LocationFlag.Stop; LastPFlag = new Plugin.Geolocator.Abstractions.Position(); if (ifDataReset == true) { platformRoad = new object();//is delete RouteCoordinates.Clear(); LastCoordinates.Clear(); DrawPoint = null; LastPFlag = null; } AppGeolocator.Current.PositionChanged -= PositionChanged; AppGeolocator.Current.PositionError -= PositionError; await AppGeolocator.StopListeningAsync(MyGeoFlag, stopGeolocator); }
public async Task StopListeningLocation(bool stopGeolocator, bool ifDataReset) { AppGeolocator.Current.PositionChanged -= PositionChanged; AppGeolocator.Current.PositionError -= PositionError; await AppGeolocator.StopListeningAsync(MyGeoFlag, stopGeolocator); if (ifDataReset == true) { RouteCoordinates.Clear(); WorkoutData.Reset(); NewWorkoutPoint = null; NumberOfPoint = 0; lastInterval = new DateTime(0); startWorkout = new DateTime(0); ResetCounter(); } }