protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); studentId = Intent.GetStringExtra("studentId"); studentIdBundle = new Bundle(); studentIdBundle.PutString("studentId", studentId); toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetActionBar(toolbar); makeBooking = new MakeBookingFragment(); myBookings = new MyBookingsFragment(); settings = new SettingsFragment(); makeBooking.Arguments = studentIdBundle; myBookings.Arguments = studentIdBundle; var startPage = Intent.GetStringExtra("StartScreen"); currentFragment = GetStartScreen(startPage); var transaction = FragmentManager.BeginTransaction(); transaction.Add(Resource.Id.mainFragmentContainer, currentFragment, "MakeBooking_Fragment"); transaction.Commit(); bookingPageTxt = FindViewById <TextView>(Resource.Id.txtbookings); addBookingPageTxt = FindViewById <TextView>(Resource.Id.txtAdd); settingsPageTxt = FindViewById <TextView>(Resource.Id.txtsettings); bookingPage = FindViewById <FontAwesome>(Resource.Id.action_mybookings); addBookingPage = FindViewById <FontAwesome>(Resource.Id.action_add); settingsPage = FindViewById <FontAwesome>(Resource.Id.action_settings); SetInitialMenuHighlight(startPage); bookingPage.Click += BookingPage_Click; addBookingPage.Click += AddBookingPage_Click; settingsPage.Click += SettingsPage_Click; }
async void CancelButton_Click(object sender, EventArgs e) { var response = await ServiceHelper.Workshop.CancelWorkshopBooking(workshopId, studentId); if (response.IsSuccess) { var builder = new AlertDialog.Builder(this.Activity); builder.SetTitle("Cancellation Confirmed!"); builder.SetMessage("You have successfully cancelled this booking"); builder.SetPositiveButton("OK", (senderAlert, args) => { Bundle bundle = new Bundle(); bundle.PutString("studentId", studentId); MyBookingsFragment myBooking = new MyBookingsFragment(); myBooking.Arguments = bundle; ChangePage(myBooking); }); builder.Create().Show(); } else { DialogHelper.ShowDialog(this.Activity, "Error", response.DisplayMessage); } }