title: Handle an event raised from background thread
body: <p>I developed a class (in C#) for sending and receiving messages over network. It creates a new thread (listener thread) which waits till a new message arrives then raises an event. 
  The problem is the event is raised in the listener thread and when I want to use this class in a wpf application, a run-time error occurs trying to handle the event
  The error is:The calling thread cannot access this object because a different thread owns it.</p>
  
  <p>Is there any proper way to deal with this situation when the event raises in the mentioned class?</p>