I am using ArcGis API for WPF in a desktop based application to show locations, route for the stops on a 2D Map.
A background thread fetches the locations (along with lat-long) from a WCF service. Then these locations are displayed on the Map as TextSymbol(s) on a GraphicLayer.
Then another background thread calls a WCF RESTfull resource to find route for the locations (stops). This call returns me a route which i am trying to display on the map using another GraphicLayer using 'Add' method of the 'Graphics' property of the layer. Whenever i try to do so, i get an exception 'The calling thread cannot access this object because a different thread owns it.'
I have tried to use Dispatcher object for the screen, the map object, the graphics layer but none seems to work for me.