|
-
Feb 19th, 2013, 08:44 AM
#1
Thread Starter
Frenzied Member
How to wait for async method on same thread?
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|