I have the following function:
public bool ShowMessageQuestion(string message)
{
var _result = Application.Current.MainPage.DisplayAlert("Test", message, "Yes", "No");
_result.Start();
return _result.Result;
}
The DisplayAlert
is an async function, so when I execute the above code, I get an exception
Start may not be called on a promise-style task
I would like to get the above code stops executing until user selects yes/no option.
Any idea?
I tried also:
var _result = Application.Current.MainPage.DisplayAlert("Test", "Message", "Yes", "No").GetAwaiter().GetResult();