Results 1 to 2 of 2

Thread: How to wait for async method on same thread?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    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

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: How to wait for async method on same thread?

    Moved to the Mobile Development forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width