private void UpdateShowProgress(bool complete) { if (complete) { _synContext.InvokeSynchronously(delegate { FileMessage = "complete"; }); //RESET ALL VALUES TO THEY CAN UPLOAD AGAIN _dataSent = 0; _dataLength = 0; _fileStream = null; _fileSize = ""; IsBusy = false; } else { _synContext.InvokeSynchronously(delegate { Percentage = Math.Round(_dataSent / (double)_dataLength * 100); FileMessage = "Total file size: " + _fileSize + " Uploading: " + string.Format("{0:###.00}%", _dataSent / (double)_dataLength * 100); IsBusy = true; }); } }