When I was in an API call Microsoft interface need to pop up Microsoft's login screen, found that only "await the Dispatcher. RunAsync (CoreDispatcherPriority. Normal, async () = >" approach run will pop up, but here can't wait to return results will execute the following code, If it's not "await the Dispatcher. RunAsync (CoreDispatcherPriority. Normal, async () = >", Microsoft's login screen can't pop up, direct return 401, excuse me, how can pop up the login interface, and can return a result, such as this is my code:
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
//WriteXML(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
back = await GetData(messageContent, "service");
//Task.Run(async () => { back = await IC.GetData(messageContent, "service"); }).Wait();
});
I need to "ask GetData(messageContent, "service");" Return the data before executing the following code