Part 28: Understanding Async and Awaitable Tasks

Sign in to queue

The Discussion

  • User profile image
    rcroeder

    I have a problem with the code for protected async void SearchResults_Loaded example. It is possible that DataContent will invalid when needed and never get populated. Once the await is executed the procedure stops executing. It is a fire and forget. The only saving grace, is that DataContent is at defined the xaml, however if the page is navigated away I gather the await would be trashed or possibly throw and exception. This may fall into the top level event handler, but not sure. There is something that causes me to be wary.

    RC

  • User profile image
    Clint

    @rcroeder: Can you provide me with repro steps on how it this will fail?  My email is clint.Rutkas@Microsoft.com 

    Also async here won't fire and forget, it will allow the UI thread to continue to be responsive but return data without having to go do a bunch of event callbacks.

    Also one thing you need to remember here is this series is for absolute beginners, only so much you can go into before they are overloaded.

Add Your 2 Cents