I am facing 2 issues with the CollectionView
:
- I have given
RemainingItemsThreshold="0"
forCollectionView
, but theRemainingItemsThresholdReached
event is firing before reaching the last item. It is calling around 6 items before the last item. - When
RemainingItemsThresholdReached
is fired, I load the next set of data and append it to theCollectionView
. But at that time, theCollectionView
is scroll to the first item. It is not stay on the last item where we load more data.
My CollectionView Code:
<CollectionView
x:Name="MyTweetsList"
Margin="0,5,0,5"
IsVisible="{Binding chatVisibility}"
ItemsSource="{Binding AllItems,Mode=TwoWay}"
RemainingItemsThreshold="0"
RemainingItemsThresholdReached="LoadMoreTweets"
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>