The following is a brief explanation:
You probably have a user interface element associated with the observed collection. When you add an item to the monitored collection, the user interface is updated to reflect the changes. However, the only thread allowed to make changes to the user interface is the main thread.
Therefore, when you add an item to the observed collection using a background thread, the user interface tries to update the background thread, which does not have the right to make changes to the user interface, and an exception is thrown.
I am sure that this line should throw an exception: //this.Coll.Add (new TestTherad ()) ;. Try debugging inside the task block.
When you use the dispatcher, you do the update using the main thread, and for this reason it works.
Updating properties works because you are simply raising an event. The structure should listen to this event and be sure to send it to the main thread automatically.
source share