I have this code that I shortened for this question:
resetButton.Clicked += async (sender, e) =>
{
var response = await X.DisplayAlert("X","Y","Yes", "No");
};
I would like to break it out into a method so I tried this:
resetButton.Clicked += resetButtonClicked;
protected void resetButtonClicked(object sender, EventArgs e)
{
var response = await X.DisplayAlert("X","Y","Yes", "No");
}
But this does not work as I need to specify the method to be async. Can someone give me some advice how I can do this?