MyDriving.ViewModel.CurrentTripViewModel.ExecuteStopTrackingTripCommandAsync C# (CSharp) Method

ExecuteStopTrackingTripCommandAsync() public method

public ExecuteStopTrackingTripCommandAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        public async Task ExecuteStopTrackingTripCommandAsync()
        {
            if (IsBusy || !IsRecording)
                return;

            try
            {
                //Unsubscribe because we were recording and it is alright
                Geolocator.PositionChanged -= Geolocator_PositionChanged;
                await Geolocator.StopListeningAsync();
            }
            catch (Exception ex)
            {
                Logger.Instance.Report(ex);
            }
        }