public static DialogFragment2 NewInstance(Bundle bundle) { DialogFragment2 fragment = new DialogFragment2(); fragment.Arguments = bundle; return(fragment); }
private void Gv_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { //FragmentTransaction ft = FragmentManager.BeginTransaction(); //fragment_Info f1 = new fragment_Info(); //f1.Show(ft, "ok"); int position = e.Position; Student student = listStudents[position]; FragmentTransaction transcation = FragmentManager.BeginTransaction(); //MyDialog signup = new MyDialog(student); //signup.Show(transcation, "Dialog Fragment"); //FragmentManager fm = getSupportFragmentManager(); DialogFragment2 alertdFragment = new DialogFragment2(); // Show Alert DialogFragment alertdFragment.Show(transcation, "Alert Dialog Fragment"); /* * AlertDialog.Builder dialog = new AlertDialog.Builder(this); * AlertDialog alert = dialog.Create(); * alert.SetTitle("Student's Information"); * //alert.SetMessage("Complex Alert"); * //alert.SetIcon(Resource.Drawable.alert); * * LayoutInflater inflater = (LayoutInflater)this.GetSystemService(Context.LayoutInflaterService); * View view = inflater.Inflate(Resource.Layout.layout_eleves_infos, null); * alert.SetView(view); * * TextView text_Nom = view.FindViewById<TextView>(Resource.Id.Nom_tv); * text_Nom.Text = "Nom: "+student.Nom; * TextView text_Prenom = view.FindViewById<TextView>(Resource.Id.Prenom_tv); * text_Prenom.Text = "Prenom:" + student.Prenom; * * TextView text_age = view.FindViewById<TextView>(Resource.Id.Age_tv); * text_age.Text = "Age: "+ student.Age; * TextView text_Address = view.FindViewById<TextView>(Resource.Id.Prenom_tv); * text_Address.Text = "Addess: "+student.Adresse; * * ImageView image_iv = view.FindViewById<ImageView>(Resource.Id.image_iv); * image_iv.SetImageResource(student.Image); * * alert.SetButton("OK", (c, ev) => * { * // Ok button click task * //string Nom = text_Nom.Text; * //string Prenom = text_Prenom.Text; * //Toast.MakeText(this, "Nom = " + Nom + " Prenom= " + Prenom, ToastLength.Long).Show(); * }); * alert.SetButton2("CANCEL", (c, ev) => { }); * alert.Show(); * */ }