Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to enable multi-threaded data binding in WPF?

0
Posted

How to enable multi-threaded data binding in WPF?

0

WPF does propagate the property changed notification across thread boundaries, but collection changed notification doesn’t get propagated , the reason is that if you marshal or propagate the collection changed notification across thread boundaries, no matter whether you marshal the collection changed notification either synchronously (Dispatcher.Invoke()) or asynchronously (Dispatcher.BeginInvoke()), there will be an interval between the time you marshal the call to the dispatcher thread, and the time the dispatcher thread is available to process the call. During this interval, the dispatcher thread would probably access the already changed source collection (note that at this interval, there would be some work items posted or sent before your work item, and those work items would possibly change the data bound source collection) and since the collection has been changed, the dispatcher thread will get the wrong value, and possibly crash eventually.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123