Exemple #1
0
        void schedule_ScheduleCellTapped(object sender, CellTappedEventArgs args)
        {
            var appointment = args.ScheduleAppointment;

            if (appointment != null)
            {
                AlertDialog.Builder alert = new AlertDialog.Builder(this);
                alert.SetTitle("Confirm delete");
                alert.SetMessage(appointment.Subject);
                alert.SetPositiveButton("Delete", async(senderAlert, arg) =>
                {
                    await apiClient.DeleteWorkplaceOrderAsync((int)appointment.RecurrenceId);
                    Toast.MakeText(this, "Deleted!", ToastLength.Short).Show();
                    Orders.Remove(appointment);
                    schedule.ItemsSource = Orders;
                    SetContentView(schedule);
                });

                alert.SetNegativeButton("Cancel", (senderAlert, arg) =>
                {
                    Toast.MakeText(this, "Cancelled!", ToastLength.Short).Show();
                });

                Dialog dialog = alert.Create();
                dialog.Show();
            }
        }
 private void RemoveExceptionAppointment_Click(object sender, System.EventArgs e)
 {
     if (scheduleAppointmentCollection.Count > 1)
     {
         var exceptionAppointment = scheduleAppointmentCollection[1];
         scheduleAppointmentCollection.Remove(exceptionAppointment);
     }
 }