Hi,
We have problem with updating appointments. We obtain exception - Sequence contains no elements in
System.Linq.Enumerable.First<Java.Util.Calendar>(System.Collections.ObjectModel.ObservableCollection<Java.Util.Calendar> source) in
Com.Syncfusion.Schedule.AppointmentEngine.GetVisibleAppointments(System.Collections.ObjectModel.ObservableCollection<Java.Util.Calendar> visibleDateRange, Com.Syncfusion.Schedule.ScheduleAppointmentCollection appointments) in
Com.Syncfusion.Schedule.SfSchedule.UpdateVisibleAppointments(System.Collections.ObjectModel.ObservableCollection<Java.Util.Calendar> visibleDates) in
Com.Syncfusion.Schedule.SfSchedule.UpdateAppointments(System.Collections.ObjectModel.ObservableCollection<Java.Util.Calendar> visibleDates) in
Com.Syncfusion.Schedule.SfSchedule.UpdateSchedule()
In constructor of calendar fragment we have:
this.WhenActivated(disposable =>
{
this.ViewModel
.Events
.Changed.Select(_ => Unit.Default)
.StartWith(Unit.Default)
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(_ =>
{
_schedule.ItemsSource = new ScheduleAppointmentCollection();
_schedule.ItemsSource = CreateAppointments();
Task.Run(() =>
{
Activity.RunOnUiThread(() =>
{
_schedule.UpdateSchedule(); <- this is problematic method
});
});
}).DisposeWith(disposable);
(...)
This method works after a while, with some delay. ItemsSource is not empty while we call update schedule.
Thanks for any help.