Private Async Sub DownloaderWorkerAsyncOne_DoWork(sender As Object, e As DoWorkEventArgs) Handles DownloaderWorkerAsyncOne.DoWork
Dim DownloadID As String = CStr(e.Argument)
Dim CurrentDownloadPath As String = downloadsPath + DownloadID + "\"
Dim CurrentDownloadFolder As StorageFolder
Dim query As String = Await Pixels_Project_API.API.v1.GetVideo(CInt(DownloadID))
DownloaderWorkerAsyncOne.ReportProgress(0, DownloadID + ":" + "Waiting")
Try
CurrentDownloadFolder = Await downloadsFolder.CreateFolderAsync(DownloadID, CreationCollisionOption.FailIfExists)
Catch ex As Exception
Alert("Error", "Folder exist")
Exit Sub
End Try
DownloaderWorkerAsyncOne.ReportProgress(1, DownloadID + ":" + "Preparing") 'ERROR HERE
//More code
End Sub
Private Sub DownloaderWorkerAsyncOne_ProgressChanged(sender As Object, e As ProgressChangedEventArgs) Handles DownloaderWorkerAsyncOne.ProgressChanged
Dim IDandState As String() = e.UserState.ToString.Split(":")
ReportWork(CStr(IDandState(0)), CStr(IDandState(1) + ":" + CStr(e.ProgressPercentage) + "%"))
End Sub
Private Async Sub ReportWork(ob As String, status As String)
Dim StatusProgress As String() = status.Split(":")
For Each down As DownloadControl In ActiveDownloads.Children
If down.MovieID = ob Then
down.Status = StatusProgress(0)
down.Progress = StatusProgress(1)
Exit For
End If
Next
End Subhttps://www.experts-exchange.com/questions/29134964/'This-operation-has-already-had-OperationCompleted-called-on-it-and-further-calls-are-illegal-'.html#a42792335
if your task is already completed, you shouldn't trigger the event.