Пример #1
0
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            global::Android.App.AlertDialog.Builder builder = new AlertDialog.Builder (nn_fragmentactivity,global::Android.App.AlertDialog.ThemeDeviceDefaultLight);
            if(!string.IsNullOrEmpty(nn_title)){
                builder.SetTitle (nn_title);
            }
            builder.SetMessage (nn_messagetext);
            builder.SetPositiveButton (nn_positivetext, delegate(object sender, global::Android.Content.DialogClickEventArgs e) {
                nn_fragmentactivity.OnDialogPositiveClick(this);
            });
            if(nn_negativetext!=null)
            {
                builder.SetNegativeButton(nn_negativetext,delegate(object sender, global::Android.Content.DialogClickEventArgs e) {
                    nn_fragmentactivity.OnDialogNegativeClick(this);
                });
            }
            builder.SetCancelable (false);

            RelativeLayout layout = (RelativeLayout) nn_fragmentactivity.LayoutInflater.Inflate (nn_layouresource, null);
            contentlayout = layout;

            builder.SetView (layout);

            dialog = builder.Create ();

            dialog.SetOnShowListener (new CustomAlterdialogOnShowListener (this,nn_fragmentactivity));

            return dialog;
        }