Example #1
0
 public CustomDialog GetDialog()
 {
     if (dialog == null)
     {
         dialog = CustomDialog.instance(Activity);
         dialog.SetCancelable(false);
     }
     return(dialog);
 }
 // dialog
 public CustomDialog getDialog()
 {
     if (dialog == null)
     {
         dialog = CustomDialog.instance(this);
         dialog.SetCancelable(true);
     }
     return(dialog);
 }
Example #3
0
        /// <summary>
        /// 获得一个弹窗实例
        /// </summary>
        /// <returns></returns>
        public CustomDialog GetDialog()
        {
            if (_dialog != null)
            {
                return(_dialog);
            }

            _dialog = CustomDialog.Instance(this);
            _dialog.SetCancelable(true);
            return(_dialog);
        }
Example #4
0
        /// <summary>
        /// Show Alert Dialog
        /// </summary>
        /// <param name="activity">Activity instance</param>
        /// <param name="title">title of alert dialog</param>
        /// <param name="messsage">message to show alert dialog</param>
        /// <returns>Dialog</returns>
        public Dialog ShowAlertDialog(string title, string messsage,
                                      string positivebtn, string negativeBtn)
        {
            try
            {
                Dialog dialog = null;
                dialog = new CustomDialog().CreateDialog(mActivity,
                                                         title,
                                                         messsage,
                                                         negativeBtn, positivebtn,
                                                         new EventHandler(async delegate(Object o, EventArgs a)
                {
                    if (dialog != null)
                    {
                        dialog.Dismiss();
                        dialog = null;
                    }
                    bool isDeleted = await DeleteCRMNotes();
                    if (isDeleted)
                    {
                        CallBackScreen();
                    }
                }),
                                                         new EventHandler(delegate(Object o, EventArgs a)
                {
                    if (dialog != null)
                    {
                        dialog.Dismiss();
                        dialog = null;
                    }
                }),
                                                         true, true);

                dialog.SetCancelable(true);
                dialog.Show();
                return(dialog);
            }
            catch (Exception e)
            {
                return(null);
            }
        }
Example #5
0
        /// <summary>
        /// Show Alert Dialog
        /// </summary>
        /// <param name="activity">Activity instance</param>
        /// <param name="title">title of alert dialog</param>
        /// <param name="messsage">message to show alert dialog</param>
        /// <returns>Dialog</returns>
        public Dialog ShowAlertDialog(Activity activity, string title, string messsage,
                                      string positivebtn, string negativeBtn)
        {
            try
            {
                Dialog dialog = null;
                dialog = new CustomDialog().CreateDialog(activity,
                                                         title,
                                                         messsage,
                                                         negativeBtn, positivebtn,
                                                         new EventHandler(delegate(Object o, EventArgs a)
                {
                    if (dialog != null)
                    {
                        dialog.Dismiss();
                        dialog = null;
                    }
                }),
                                                         new EventHandler(delegate(Object o, EventArgs a)
                {
                    if (dialog != null)
                    {
                        dialog.Dismiss();
                        dialog = null;
                    }
                }),
                                                         true, false);

                dialog.SetCancelable(true);
                dialog.Show();
                return(dialog);
            }
            catch (Exception e)
            {
                return(null);
            }
        }