monotouch实现winform中ShowDialog效果

   在monotouch中,弹出对话框 ,是通过实例化 UiAlterView来实现的,如果你想实现弹出对话框后能和用户交互,即用户可以选择“是”或“否”来决定是否执行某个功能,就需要用到下面这段代码。

   

  int clicked = -1;
  var showDialog = new UIAlertView("任务", "您确定要提交任务?", null, "Cancel", "Ok");
  showDialog.Show();
  showDialog.Clicked += (sender,buttonArgs) => {
             clicked = buttonArgs.ButtonIndex;
             if (clicked == 0) {
                        return;
             }
             if (clicked == 1) {
                        //coding: execute your code;

             }
  };

   效果图如下:

   

 

posted @ 2012-10-31 17:36  flowbywind  阅读(946)  评论(0编辑  收藏  举报