Multithread Communication

Posted by Robert on Stack Overflow See other posts from Stack Overflow or by Robert
Published on 2010-05-30T01:12:06Z Indexed on 2010/05/30 1:22 UTC
Read the original article Hit count: 289

Filed under:
|
|

I'm creating a WPF application that uses a custom object to populate all the controls. The constructor of that object is initiated by an EventHandler that waits for an API. The problem I'm having is when I try to access any information from that object using a button for example, it returns an error saying "The calling thread cannot access this object because a different thread owns it". I'm assuming this is because the EventHandler creates a new thread which doesn't allow the MainThread to have access to it. Any ideas on how to get around this?

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf