Hello,
As I understand, you change the ItemSource
of the TabbedPage
to load more tabs by the LoadNextPage()
method.
at this moment again and again selected index change method is going on calling
You could try finding the index, then tell if the item is the last one, after that you can load more items and set the CurrentPage
.
private async void MainPage_CurrentPageChanged(object? sender, EventArgs e)
{
var index = this.Children.IndexOf(this.CurrentPage);
//MonkeyDataModel.All is the ItemsSource="{x:Static local:MonkeyDataModel.All}"
if (index == MonkeyDataModel.All.Count-1) {
LoadNextPage();
CurrentPage = Children[1];
}
}
Best Regards,
Wenyan Zhang
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.