hi,
when user swipe day calendar, i am fetching appointments from server in calendar DisplayDateChanged event, those server calls are under "await". This take some time to complete and then use those data to set calendar appointment source, then DisplayDateChanged event automatically fires and setting date to previously where it was. so calendar can not scroll to where user wants. This may be because of time taken to fetch data or again setting appointment source of calendar.
can reproduce using following code.
private
async
void
daycalendar_DisplayDateChanged (
object
sender, Telerik.XamarinForms.Common.ValueChangedEventArgs<
object
> e)
{
await longrun();
}
private
async Task longrun()
{
ObservableCollection<testmodel> items =
new
ObservableCollection<testmodel>();
for
(
int
i = 0; i < 10; i++)
{
var item =
new
testmodel
{
Title =
"Meeting with Tom"
+ i,
Detail =
"Sea Garden"
,
StartDate = DateTime.Now,
EndDate = DateTime.Now.AddHours(1),
Color = Color.Tomato
};
items.Add(item);
}
weekcalendar.AppointmentsSource = items;
}
}
testmodel as is this
public
class
testmodel : IAppointment, INotifyPropertyChanged
tested only in Android. Any solution ?