Returning a value from Dispatcher.RunAsync() to background thread
问题 I'm using Dispatcher.RunAsync() to show a MessageDialog from a background thread. But I'm having trouble figuring out how to get a result returned. My code: bool response = false; await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () => { DebugWriteln("Showing confirmation dialog: '" + s + "'."); MessageDialog dialog = new MessageDialog(s); dialog.Commands.Add(new UICommand(GetLanguageString("Util_DialogButtonYes"), new UICommandInvokedHandler((command) => {