码迷,mamicode.com
首页 > Windows程序 > 详细

C# 使用Xamarin 开发应用 -- Alert Box

时间:2015-04-18 17:46:50      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:

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();
		}
	}




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


C# 使用Xamarin 开发应用 -- Alert Box

标签:

原文地址:http://blog.csdn.net/lan_liang/article/details/45114445

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!