Hello,
You can add a Task.Delay
before executing the scroll event in the ListDates_BindingContextChanged
method, here is my edited code.
private async void ListDates_BindingContextChanged(object sender, EventArgs e) {
var lst = (ObservableCollection<DateItem>)((CollectionView)sender).ItemsSource;
lblMonth.Text = lst.First().Year + " " + lst.First().Month;
MyBindingList = lst;
//var items = newValue as ObservableCollection<DateItem>;
//var control = (CalendarView)bindable;
var index = lst.ToList().FindIndex(p => p.Selected);
if (index > -1)
{
await Task.Delay(500);
listDates.ScrollTo(index, -1, ScrollToPosition.MakeVisible, true);
}
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.