It seems you can not use Await to show error message in Try-Catch Statement:
MessageDialog mError = new MessageDialog("Error: You entered: " + txtNbr.text , "Not a Number");
await mError.ShowAsync();
How to show error message in Try-Catch Block ??
Thanks
------- Update
I got error for this " Unspecific Error "
public async void Populate()
{
try
{
string PrintText = "";
//--- Create a Run of plain text and some bold text.
Windows.UI.Xaml.Documents.Run myRun1 = new Run();
myRun1.Text = "testing testing testing \n 1213131313 \n";
P1.Inlines.Add(myRun1);
textContent.Blocks.Add(P1);
}
catch (Exception ex)
{
ErrorMessage = ex.Message;
}
if (ErrorMessage != "")
{
MessageDialog mError = new MessageDialog(ErrorMessage, "Error");
await mError.ShowAsync();
ErrorMessage = "";
}
}