uno.extensions
uno.extensions copied to clipboard
[Reactive] Change pagination uint to int
Intro
MVUX pagination methods use uint methods.
If I understand correctly this is because no negative values are expected to be used.
uint is also used in ISupportIncrementalLoading.LoadMoreItems
Request
My requst is to consider changing the uints to ints.
Reasons
- Standard integer is common use by developers and using uint requires a lot of redundant and tedious casting. Personally I think it's worth the overhead of a param check and throw an exception if arg out of range
- No support for uint in XAML
- In some scenarios a negative value could be valid, for example when navigating backwards
This should be discussed and either moved forward or discarded in 5.0 timeframe
Personally I think we should keep uint:
- It's the structure used by more and more dotnet APIs, especially UWP/WinUI and specifically the
ISupportIncrementalLoading.LoadMoreItemsAsync(https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.data.isupportincrementalloading.loadmoreitemsasync?view=winrt-22621) (which is the interface supported by the view to trigger the pagination) - Negative page indexes are not supported by this API and will not since it would require to have more parameters to determine the initial page index. And considering that pagination using index APIs are just special case of the pagination by cursor and are designed to ease the common case, I think that we will not try to provide such support in those APIs as it's definitely not the "common case".
- Using
intin endpoint is 99% an error from developers, as the API will reject any negative index.uintis the most appropriate structure.
Initializes incremental loading from the view.