This api was accessed with arguments from the wrong context

Niteen 6 years ago in Question updated 6 years ago 1

We are adding and removing the ModelVisual3D object using background worker process and we got the the following error message:

Error : "This api was accessed with arguments from the wrong context"

Here is my code:

Private Sub backgroundWorker_ProgressChanged(sender As Object, e As ProgressChangedEventArgs)

Dim list = helixViewport3D.Children.OfType(Of ModelVisual3D).ToList()
For Each item As ModelVisual3D In list
If TypeOf item Is ModelVisual3D AndAlso item.GetName() = "Mesh" Then
End If
Dim visual = CType(e.UserState, ModelVisual3D)
End Sub

We are used the BackgroundWorker thread to update the UI from background process. Can you please suggest how to solve this issue.

Please find the attached screem shot.

Niteen Patil

Please find the attached screen shot for above message.

Please suggest the solution.