Quantcast
Channel: VBForums - Mobile Development
Viewing all articles
Browse latest Browse all 96

How to wait for async method on same thread?

$
0
0
Hi!

I am working on a program for phone 8. What is different here is that async calls are executed on the main UI thread, hence I can't use the AutoResetEvent WaitOne() and Set() methods since the WaitOne will block the UI thread, and the program will halt.

So, my question is how I can solve this? I am working in a Portable Class Library, and I have access to wait and async keywords, but not to the Task class (System.Threading.Tasks) is not available. I tried to use an interface class between the phone 8 class and the PLC class, but the return type of the method has to be of type Task if I can use the await keyword... it is quite a mess.

Anyone has any ideas on how I can make an async call, wait for it to finish with the above settings..

kind regards
Henrik

Viewing all articles
Browse latest Browse all 96

Trending Articles



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