CollectionChanged notification across threads?
Posted
by Mark
on Stack Overflow
See other posts from Stack Overflow
or by Mark
Published on 2010-05-07T03:19:06Z
Indexed on
2010/05/07
3:28 UTC
Read the original article
Hit count: 286
I'm writing a download manager using C#/WPF, and I just encountered this error:
This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread.
The basic flow of my program is that a few web pages/downloads are enqueued at the start, and then they're downloaded asynchronously. When an HTML page has completed downloading, I parse it and look for more stuff to download, then enqueue it directly from within the worker thread.
I get that error when trying to send out the CollectionChanged
event on my customized queue class. However, I need to fire that event so that the GUI can get updated.
What are my options?
© Stack Overflow or respective owner