public static LightingDialogFragment NewInstance(Bundle bundle) { var fragment = new LightingDialogFragment { Arguments = bundle }; return(fragment); }
private void CreateLightingDialog(int position) { var ft = ChildFragmentManager.BeginTransaction(); //Remove fragment else it will crash as it is already added to backstack var prev = ChildFragmentManager.FindFragmentByTag("lightingDialog"); if (prev != null) { ft.Remove(prev); } ft.AddToBackStack(null); // Create and show the dialog. var bundle = new Bundle(); bundle.PutString("floor", _items[position].Floor); bundle.PutString("descr", _items[position].Description); var newFragment = LightingDialogFragment.NewInstance(bundle); //Add fragment newFragment.Show(ft, "lightingDialog"); }