I have a graphics layer that has many Graphics on it. This graphics may change depending on clients selection. Since it takes some time to recreate the graphics and add them to the layer, I thought it would be nice to just recreate the layer in a different thread, return it in the WorkItem of the thread that did the work and replace it in the map.
When I try to add the new layer to the Map though I get this error:
The calling thread cannot access this object because a different thread owns it
To try to solve this problem, I used the dispatcher of the Map like this: