Quantcast
Viewing all articles
Browse latest Browse all 18858

Threading issue

Hello all,

I'm fairly new to WPF and i'm running into an issue with threads and UI.

So I have a MainWindow class containing a grid which is filled initially with UserControl1.

UserControl1 has a button that does some processing asynchronously and afterwards fires the Completion event. The Completion event gets caught by MainWindow which closes UserControl1 and opens UserControl2.

Because the event is being fired by the thread that was spun off during the asynchronous process it is throwing this:

The calling thread cannot access this object because a different thread owns it.

Any Ideas? if you need any more information please let me know


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>