Home >Backend Development >C#.Net Tutorial >C# uses Xamarin to develop applications -- Alert Box

C# uses Xamarin to develop applications -- Alert Box

黄舟
黄舟Original
2017-03-01 10:36:571452browse


public static class AlertExtension
	{
		public static void ShowAlert(this Activity activity ,string msg,string title = "", string btnText = "OK"){
			AlertDialog.Builder builder = new AlertDialog.Builder(activity);
			builder.SetTitle(title);
			builder.SetMessage(msg);
			builder.SetCancelable(false);
			builder.SetPositiveButton(btnText, delegate {
					// it is alert ,keep it simple , do nothing here 
				});
			builder.Show();
		}
	}

Huancuan敕镞讹综合

if(txtPwd.Text != txtCfmPwd.Text){
					this.ShowAlert("Password and confirmed password not match");
				}

The above is the content of C# using Xamarin to develop applications-Alert Box, more For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn