Monday, July 29, 2013

Crash when calling Task.Result from UI-Thread

Hi, XnDerKai


It's because you are not waiting for task DoSomething() to execute. Instead you should change your code like this



protected override async void OnNavigatedTo(NavigationEventArgs e)
{
bool result = await DoSomething().Result;
result = false;
}

this approach will work for you.

No comments:

Post a Comment