I need to wait the result of a MessageDialog
when my UWP application starts, during the splash screen. So, I put this MessageDialog
inside the MainPage
constructor:
private async Task ParseConfiguration()
{
var dialog = new MessageDialog("Message", "Title");
dialog.Commands.Add(new UICommand { Label = "Exit", Id = 0 });
await dialog.ShowAsync();
}
public MainPage()
{
ParseConfiguration(); // works, but I need to wait
ParseConfiguration().Wait(); // never exits this call
}
How can I fix this problem?