private void CapturingLivePhotoAction(bool capturing) { _sessionQueue.DispatchAsync(() => { InProgressLivePhotoCapturesCount += capturing ? 1 : -1; DispatchQueue.MainQueue.DispatchAsync(() => { if (InProgressLivePhotoCapturesCount >= 0) { _photoCapturingDelegate?.CaptureSessionDidChangeNumberOfProcessingLivePhotos(this); } else { Console.WriteLine( "capture session: error - in progress live photo capture count is less than 0"); } }); }); }