Hi
Juan,
#Regarding
delete all the appointments and add new appointment in the SfCalendar
We
suggest that you remove all appointment from the view model collection after
removing it from the Firebase database and add the new item to the view model
collection along with the FireBase Database. This way, the change will be
reflected in the view immediately. Please refer to the following code snippet
for your reference.
Code
snippet
private async void allDelete_Clicked(object sender, EventArgs e)
{
foreach (var appointment in
viewmodel.Appointments)
{
await firebaseHelper.DeleteEvent(appointment.Subject);
}
viewmodel.Appointments.Clear();
DateTime today = DateTime.Now.Date;
var newAppointment = new
CalendarInlineEvent() { StartTime = today.AddHours(16), EndTime =
today.AddHours(17), Subject = "new item" };
viewmodel.Appointments.Add(newAppointment);
await firebaseHelper.AddEvents(newAppointment.StartTime,
newAppointment.EndTime, newAppointment.Subject);
}
|
Please
refer to the demo sample in the attachment. Please let us know if you have any
concerns.
Regards,
SaiGanesh Sakthivel
Attachment:
CalendarXamarin_7872ae79.zip