Originally, I used private async void for the Control GridView's Item Click. When I changed it to private async Task
I got error Msg :
ItemsGridView_ItemClick(object, Windows.UI.Xaml.Controls.ItemClickEventArgs)' has the wrong return type
What I wanted:
- to show whatever error message in Try-catch in MessageDialog and exit
private async Task ItemsGridView_ItemClick(object sender, ItemClickEventArgs e)
{
bool ShowError = false;
System.Exception MyException = new Exception();
try
{
-- call Async Method --
}
catch (Exception ex)
{
ShowError = true;
MyException = ex;
}
if (ShowError)
{
var MyMessageBox = new Windows.UI.Popups.MessageDialog(MyException.Message,"Selecting Item");
await MyMessageBox.ShowAsync();
}
}