英文:
RemainingItemsThresholdReachedCommand doesn't execute for CollectionView on iOS
问题
I set up an infinite scrolling logic on a CollectionView
where IsGrouped = True
. It works as expected on Android, but from the very beginning it never worked on iOS, Windows, and MacCatalyst (as the command doesn't execute at all on these platforms). Now data to retrieve from the cloud for my application are becoming massive and I can't afford loading everything at once in my collection anymore.
Is there anything I can do to solve this issue? Or (if this is just a bug) is there any workaround I can apply to avoid setting a button to load pages one by one?
Here's the XAML code:
<Grid
Grid.Row="3"
VerticalOptions="Fill">
<CollectionView
ItemsSource="{Binding ListItemsGroup}"
SelectionMode="Single"
SelectedItem="{Binding CurrentItem, Mode=TwoWay}"
RemainingItemsThreshold="2"
RemainingItemsThresholdReachedCommand="{Binding LoadMoreItemsCommand}"
IsGrouped="True">
英文:
I set up an infinite scrolling logic on a CollectionView
where IsGrouped = True
. It works as expected on Android, but from the very beginning it never worked on iOS, Windows and MacCatalyst (as the command doesn't execute at all on these platforms). Now data to retrieve from the cloud for my application are becoming massive and I can't afford loading everything at once in my collection anymore.
Is there anything I can do to solve this issue? Or (if this is just a bug) is there any workaround I can apply to avoid setting a button to load pages one by one?
Here's the XAML code:
<Grid
Grid.Row="3"
VerticalOptions="Fill">
<CollectionView
ItemsSource="{Binding ListItemsGroup}"
SelectionMode="Single"
SelectedItem="{Binding CurrentItem, Mode=TwoWay}"
RemainingItemsThreshold="2"
RemainingItemsThresholdReachedCommand="{Binding LoadMoreItemsCommand}"
IsGrouped="True">
答案1
得分: 3
这是一个已知问题,正在以下链接中进行跟踪,您可以在那里进行跟进。
https://github.com/dotnet/maui/issues/10078
https://github.com/dotnet/maui/issues/13391
命令 RemainingItemsThresholdReachedCommand
仅在 Android 上工作,但在 iOS 或 Windows 上不起作用,即滚动没有效果,并且在命令 RemainingItemsThresholdReachedCommand
中设置的断点永远不会被调用。
英文:
Yes, this is a known issue that being tracked in the links below, you can follow up there.
https://github.com/dotnet/maui/issues/10078
https://github.com/dotnet/maui/issues/13391
The command RemainingItemsThresholdReachedCommand
only works on Android but does not work on iOS or Windows, i.e. Scrolling has no effect and a breakpoint set in the Command RemainingItemsThresholdReachedCommand
is never being called.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论