Xamarin Forms: Show Confirm Popup Window

11/3/2016 2:53:50 PM

The following will create a Xamarin Forms button that will show a popup confirm dialog and handle the user's input.

<!-- in XAML File -->
<Button Text="Clear"             

//C# XAML File Code Behind
async void butClear_onClick(object sender, EventArgs e)
	var confirmed = await DisplayAlert("Confirm", "Are you sure?", "Yes", "No");
	if (confirmed)
		//add code for the "Yes" logic
		//add code for the "No" logic