private void MAdapter_ItemClick(object sender, int i)
        {
            MainActivity.IsNavDisabled = true;
            Fragment fragment = RestaurantViewFragment.NewInstance(restaurants[i].Id);

            FragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .AddToBackStack(null)
            .Commit();
        }
        public static RestaurantViewFragment NewInstance(int id)
        {
            var f = new RestaurantViewFragment {
                Arguments = new Bundle()
            };
            Bundle args = new Bundle();

            args.PutInt("id", id);
            f.Arguments = args;
            return(f);
        }
        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.view_restaurant)
                {
                    Fragment fragment = RestaurantViewFragment.NewInstance(booking.RestaurantId);
                    FragmentManager.BeginTransaction()
                    .Replace(Resource.Id.content_frame, fragment)
                    .AddToBackStack(null)
                    .Commit();
                }
                else if (id == Resource.Id.cancel_booking)
                {
                    new Android.App.AlertDialog.Builder(Activity).
                    SetIcon(Android.Resource.Drawable.IcDialogAlert).
                    SetTitle("Confirm").
                    SetMessage("Are you sure you want to cancel the booking?").
                    SetPositiveButton("Yes", (c, ev) =>
                    {
                        bool res = _bookingFacade.Cancel(booking.Id).Result;

                        if (res)
                        {
                            Toast.MakeText(Activity, "Booking Cancelled", ToastLength.Long).Show();
                            Fragment fragment = BookingIndexFragment.NewInstance();
                            FragmentManager.BeginTransaction()
                            .Replace(Resource.Id.content_frame, fragment)
                            .Commit();
                        }
                        else
                        {
                            Toast.MakeText(Activity, "An error occured whilst cancelling. Please try again later", ToastLength.Long).Show();
                        }
                    }).
                    SetNegativeButton("No", (c, ev) =>
                    {
                    }).
                    Show();
                }
            }

            return(base.OnOptionsItemSelected(item));
        }