I have a two-page WinRT application where the first goes to the second. I want to ask the user in OnNavigatingFromif he really wants to go to the second, through the message box. Canceling navigation is done by installing .Cancel=truefrom eventargs..., which I can do AFTER the end of the message window.
My problem is what MessageDialog.ShowAsyncis an asynchronous method.
1. Unable to execute .AsTask().Result... which causes a dead end, of course.
2. It is impossible to use awaitbecause OnNavigatingFrom- void, so turning on async causes the caller to return immediately when I wait ShowAsync().AsTask().Result.
source
share