CollectionView’s RemainingItemsThresholdReached event firing before loading the data on UI

I have a collectionview on my UI and I load 20 items initially. I have added RemainingItemsThresholdReached event for loading next 20 items when I reach the end of first 20 items. But after loading first 20 it is instantly load the next 20 and again load the next 20 and repeated up to load all the items.

I have added the same kind of logic on a different page and on there it is working fine. So I suspect the issue is with the layout used on that page. Below I have added the layout structure I am using.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage 
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
    xmlns:rgAnimations="clr-namespace:RGPopup.Maui.Animations;assembly=RGPopup.Maui" 
    xmlns:pages="clr-namespace:RGPopup.Maui.Pages;assembly=RGPopup.Maui"
    NavigationPage.HasNavigationBar="false"
    xmlns:maps="http://schemas.microsoft.com/dotnet/2021/maui/maps"
    xmlns:sensors="clr-namespace:Microsoft.Maui.Devices.Sensors;assembly=Microsoft.Maui.Essentials"
    xmlns:ffimageloading="clr-namespace:FFImageLoading.Maui;assembly=FFImageLoading.Maui"
    xmlns:fftransformations="clr-namespace:FFImageLoading.Transformations;assembly=FFImageLoading.Maui"
    BackgroundColor="White">

    <ContentPage.Resources>
        <ResourceDictionary>
            <local2:ProfileNameConverter x:Key="nameConverter"></local2:ProfileNameConverter>
            <local3:DatetimeToStringConverter x:Key="cnvDateTimeConverter"></local3:DatetimeToStringConverter>
            <local3:TweetUrlsLinkconverter x:Key="urlJoinConverter"></local3:TweetUrlsLinkconverter>
            <local3:SpecialCharactorConverter x:Key="specialCharactorConverter"></local3:SpecialCharactorConverter>
        </ResourceDictionary>
    </ContentPage.Resources>
    
    <ContentPage.Content>
        <StackLayout>
            <Grid BackgroundColor="#eeeeee">
                <Grid.RowDefinitions>
                    <RowDefinition Height="{OnIdiom Phone=60, Tablet=90, Desktop=60}" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1.5*" />
                    <ColumnDefinition Width="7*" />
                    <ColumnDefinition Width="1.5*" />
                </Grid.ColumnDefinitions>

                    //Header layout
                
            </Grid>

            <ScrollView 
                x:Name="frienddetails_scrollview"
                IsVisible="False"
                Orientation="Vertical" 
                VerticalOptions="FillAndExpand" 
                HorizontalOptions="FillAndExpand">
                
                <StackLayout
                    Margin="15">
                    
                    //Middle layout

                    <CollectionView 
                        x:Name="historyCollectionView"
                        SelectionMode="None"
                        RemainingItemsThreshold="1"
                        RemainingItemsThresholdReached="LoadMoreHistory"
                        BackgroundColor="#ffffff">
                        <CollectionView.ItemTemplate>
                            <DataTemplate>
                                <StackLayout
                                    Margin="0,0,0,10">
                                    <StackLayout
                                        x:Name="Day_layout"
                                        Orientation="Vertical"
                                        BackgroundColor="#eeeeee"
                                        Padding="5">
                                        
                                        <Label
                                            Text="{Binding userLocationTO.createdTime,Converter={StaticResource cnvDateTimeConverter}}"
                                            TextColor="#313131"
                                            Margin="10,0,0,0"
                                            HorizontalOptions="Start"
                                            HorizontalTextAlignment="Center">
                                            <Label.FontSize>
                                                <OnIdiom x:TypeArguments="x:Double">
                                                    <OnIdiom.Phone>18</OnIdiom.Phone>
                                                    <OnIdiom.Tablet>27</OnIdiom.Tablet>
                                                    <OnIdiom.Desktop>18</OnIdiom.Desktop>
                                                </OnIdiom>
                                            </Label.FontSize>
                                        </Label>
                                    </StackLayout>

                                    <Grid Margin="10,0,0,0">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="10*" />
                                            <!--<ColumnDefinition Width="4*" />-->
                                        </Grid.ColumnDefinitions>

                                        <StackLayout
                                            Grid.Column="0"
                                            Orientation="Vertical">
                                            <StackLayout
                                                Orientation="Horizontal"
                                                Margin="0,10,0,0">
                                                <Image 
                                                    Source="{Binding IconType}"
                                                    VerticalOptions="CenterAndExpand"
                                                    HorizontalOptions="Start">
                                                    <Image.WidthRequest>
                                                        <OnIdiom x:TypeArguments="x:Double">
                                                            <OnIdiom.Phone>20</OnIdiom.Phone>
                                                            <OnIdiom.Tablet>30</OnIdiom.Tablet>
                                                            <OnIdiom.Desktop>20</OnIdiom.Desktop>
                                                        </OnIdiom>
                                                    </Image.WidthRequest>
                                                    <Image.HeightRequest>
                                                        <OnIdiom x:TypeArguments="x:Double">
                                                            <OnIdiom.Phone>20</OnIdiom.Phone>
                                                            <OnIdiom.Tablet>30</OnIdiom.Tablet>
                                                            <OnIdiom.Desktop>20</OnIdiom.Desktop>
                                                        </OnIdiom>
                                                    </Image.HeightRequest>
                                                </Image>

                                                <Label 
                                                    x:Name="Emergency_label"
                                                    Text="{Binding triggerType}"
                                                    HorizontalOptions="Start"
                                                    VerticalOptions="CenterAndExpand"
                                                    TextColor="#1c98d7">
                                                    <Label.FontSize>
                                                        <OnIdiom x:TypeArguments="x:Double">
                                                            <OnIdiom.Phone>16</OnIdiom.Phone>
                                                            <OnIdiom.Tablet>24</OnIdiom.Tablet>
                                                            <OnIdiom.Desktop>16</OnIdiom.Desktop>
                                                        </OnIdiom>
                                                    </Label.FontSize>
                                                </Label>
                                            </StackLayout>


                                            <Grid>
                                                <Label 
                                                    Text="{Binding AllAudits}"
                                                    HorizontalOptions="Start"
                                                    VerticalOptions="CenterAndExpand"
                                                    Margin="0,2,0,8"
                                                    TextColor="#545454">
                                                    <Label.FontSize>
                                                        <OnIdiom x:TypeArguments="x:Double">
                                                            <OnIdiom.Phone>14</OnIdiom.Phone>
                                                            <OnIdiom.Tablet>21</OnIdiom.Tablet>
                                                            <OnIdiom.Desktop>14</OnIdiom.Desktop>
                                                        </OnIdiom>
                                                    </Label.FontSize>
                                                </Label>
                                            </Grid>
                                        </StackLayout>
                                    </Grid>
                                </StackLayout>
                            </DataTemplate>
                        </CollectionView.ItemTemplate>
                    </CollectionView>

                    <Label
                        VerticalOptions="CenterAndExpand"
                        HorizontalOptions="CenterAndExpand"
                        HorizontalTextAlignment="Center"
                        IsVisible="False"
                        Text="No history found!"
                        x:Name="no_history_label">
                        <Label.FontFamily>
                            <OnPlatform x:TypeArguments="x:String">
                                <On Platform="iOS" Value="Roboto-Light" />
                                <On Platform="Android" Value="Roboto-Light.ttf#Roboto-Light" />
                                <On Platform="UWP" Value="Assets/Fonts/Roboto-Light.ttf#Roboto" />
                            </OnPlatform>
                        </Label.FontFamily>
                        <Label.FontSize>
                            <OnIdiom x:TypeArguments="x:Double">
                                <OnIdiom.Phone>18</OnIdiom.Phone>
                                <OnIdiom.Tablet>26</OnIdiom.Tablet>
                                <OnIdiom.Desktop>18</OnIdiom.Desktop>
                            </OnIdiom>
                        </Label.FontSize>
                    </Label>

                    <StackLayout x:Name="chat_stack" IsVisible="{Binding chatVisibility}" VerticalOptions="Fill" >
                        <StackLayout.HeightRequest>
                            <OnIdiom x:TypeArguments="x:Double">
                                <OnIdiom.Phone>600</OnIdiom.Phone>
                                <OnIdiom.Tablet>900</OnIdiom.Tablet>
                                <OnIdiom.Desktop>600</OnIdiom.Desktop>
                            </OnIdiom>
                        </StackLayout.HeightRequest>

                        <RefreshView  
                            IsVisible="{Binding chatVisibility}"
                            IsRefreshing="{Binding IsRefreshing}"
                            Command="{Binding RefreshCommand}">

                            <CollectionView 
                                x:Name="MyTweetsList" 
                                Margin="0,5,0,5"
                                ItemsSource="{Binding AllItems,Mode=TwoWay}"
                                RemainingItemsThreshold="0"
                                IsVisible="{Binding chatVisibility}"
                                RemainingItemsThresholdReached="LoadMoreTweets"
                                VerticalOptions="FillAndExpand"
                                HorizontalOptions="Fill">
                                <CollectionView.ItemTemplate>
                                    <DataTemplate>
                                        <StackLayout
                                            x:Name="Item"
                                            HorizontalOptions="Fill"
                                            VerticalOptions="FillAndExpand"
                                            Orientation="Vertical">

                                            
                                        </StackLayout>
                                    </DataTemplate>
                                </CollectionView.ItemTemplate>
                                <CollectionView.HeightRequest>
                                    <OnIdiom x:TypeArguments="x:Double">
                                        <OnIdiom.Phone>400</OnIdiom.Phone>
                                        <OnIdiom.Tablet>600</OnIdiom.Tablet>
                                        <OnIdiom.Desktop>400</OnIdiom.Desktop>
                                    </OnIdiom>
                                </CollectionView.HeightRequest>
                            </CollectionView>
                        </RefreshView>
                    </StackLayout>

                    <Label
                        VerticalOptions="CenterAndExpand"
                        HorizontalOptions="CenterAndExpand"
                        IsVisible="{Binding ComingSoonVisibility}"
                        HorizontalTextAlignment="Center"
                        Text="No Messages Yet."
                        x:Name="no_announcement_label">
                        <Label.FontFamily>
                            <OnPlatform x:TypeArguments="x:String">
                                <On Platform="iOS" Value="Roboto-Light" />
                                <On Platform="Android" Value="Roboto-Light.ttf#Roboto-Light" />
                                <On Platform="UWP" Value="Assets/Fonts/Roboto-Light.ttf#Roboto" />
                            </OnPlatform>
                        </Label.FontFamily>
                        <Label.FontSize>
                            <OnIdiom x:TypeArguments="x:Double">
                                <OnIdiom.Phone>18</OnIdiom.Phone>
                                <OnIdiom.Tablet>26</OnIdiom.Tablet>
                                <OnIdiom.Desktop>18</OnIdiom.Desktop>
                            </OnIdiom>
                        </Label.FontSize>
                    </Label>
                </StackLayout>
            </ScrollView>
            
            <Grid 
                x:Name="tweetBox"
                IsVisible="False"
                Margin="0,0,0,10">

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="8*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                //message sending layout
            </Grid>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

I have issue with the historyCollectionView and have another CollectionView on the same page.

Can anyone tell what is the issue by checking the above xaml layout codes?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật