public override bool OnOptionsItemSelected(IMenuItem item) { if (IsActive) { int id = item.ItemId; if (id == Android.Resource.Id.Home) { MainActivity.IsNavDisabled = false; Activity.OnBackPressed(); return(true); } else if (id == Resource.Id.book_table) { if (GenericFacade.UserName != null && GenericFacade.UserName != "") { MainActivity.IsNavDisabled = true; IsActive = false; Android.App.DialogFragment dialog = BookingNewDialogFragment.NewInstance(restaurant.Id); dialog.Show(FragmentManager, "fragmentDialog"); } else { Toast.MakeText(Activity, "Please login before booking a table", ToastLength.Long).Show(); } } } return(base.OnOptionsItemSelected(item)); }
public static BookingNewDialogFragment NewInstance(int id) { BookingNewDialogFragment f = new BookingNewDialogFragment(); Bundle args = new Bundle(); args.PutInt("id", id); f.Arguments = args; return(f); }