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
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