Tools: String Manipulations Find Dupes My IP Json Formatter Lorem Ipsum More...
Discussion Options
ajax animation

Xamarin Forms: Show Confirm Popup Window

11/3/2016 10:53:50 AM by: CodeLocker

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

View Copy: Content Copied
<!-- in XAML File -->
<Button Text="Clear"             
              Clicked="butClear_onClick"
></Button>

//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
	}
	else
	{
		//add code for the "No" logic
	}            
}
Copy: Content Copied
ajax animation
×

Get Coding

Store your first code or add more code to your collection.
You must login to report abuse. ×