private void RunBackup() { _stopwatch.Start(); _dispatcherTimer.Start(); Task.Run(() => { FinishButtonTitle = "Cancel Backup"; Status = "Getting backup size..."; if (!Directory.Exists(BackupLocation)) { TellUserBackupFailed("Error: Backup directory doesn't exist"); } else { _backupPerformer.CalculateBackupSize(Items, BackupLocation); ulong freeDriveBytes = Utilities.DriveFreeBytes(BackupLocation); if (_totalBackupSize > freeDriveBytes) { var error = string.Format("Can't perform backup: not enough free space -- need {0} but only have {1}", ByteSize.FromBytes(_totalBackupSize), ByteSize.FromBytes(freeDriveBytes));; TellUserBackupFailed(error); } else { Status = "Performing backup..."; _backupPerformer.PerformBackup(Items, BackupLocation); if (!_backupPerformer.HadError) // if error, message already handled { if (_backupPerformer.HasBeenCanceled) { TellUserBackupFailed("Backup was canceled"); } else { TellUserBackupSucceeded("Backup successfully finished"); } } } } }); }