RemainingItemsThresholdReachedCommand doesn't execute for CollectionView on iOS

huangapple go评论73阅读模式
英文:

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:

    &lt;Grid
        Grid.Row=&quot;3&quot;
        VerticalOptions=&quot;Fill&quot;&gt;

        &lt;CollectionView
            ItemsSource=&quot;{Binding ListItemsGroup}&quot;
            SelectionMode=&quot;Single&quot;                   
            SelectedItem=&quot;{Binding CurrentItem, Mode=TwoWay}&quot;
            RemainingItemsThreshold=&quot;2&quot;
            RemainingItemsThresholdReachedCommand=&quot;{Binding LoadMoreItemsCommand}&quot;
            IsGrouped=&quot;True&quot;&gt;

答案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.

huangapple
  • 本文由 发表于 2023年5月22日 21:24:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76306677.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定