-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request to include ObservableRangeCollection
, an updated ObservableCollection
available as part of Xamarin.CommunityToolkit and MVVM Helpers
#256
Comments
This has been proposed already, but is not planned. We're trying to just push for .NET 7 to add support for this built-in 🙂 |
Hi, @Sergio0694 |
IMO, this should've made it to the v8.2.0 of the toolkit. Unfortunately, this issue stands closed. @Sergio0694 kindly consider reopening this to make the toolkit even more usable. |
@Sergio0694 Sorry to ask again... is your answer a definite no? |
That's correct, this is not something we'll add 🙂 |
But, so far I'm using MvvmHelpers's implementation, and it seems perfectly fine... unless there is something I'm not understanding. |
There's a lot of traction on this feature and .NET 8 being an LTS release, many would prefer to migrate to this release. Since hardly there's little time left, maybe two more public previews, before the API freeze in an RC release. So kindly highlight it to the runtime team on the need to implement this at the earliest. Thanks in advance. |
@tranb3r I've added more context in dotnet/runtime#18087 (comment) and following comments, you can just read from there and not go through the entire discussion. TLDR: it's complicated and will cause problems on some frameworks 😅
They're aware of the request, but as we mentioned in that discussion, this is a particularly tricky problem. I am not optimistic this will make it in .NET 8 at all. In fact at this point I'm relatively confident it'll miss this release, unfortunately. |
Ok, so I understand it's too complicated to implement it in the BCL. |
No it's actually the other way around 😅 |
So, again, maybe this could be added to CommunityToolkit.Maui? They rejected it because they thought it would be implemented in dotnet or CommunityToolkit.Mvvm. cc @brminnick |
Adding this to the MAUI toolkit would have the same exact issues. It might work in some scenarios, but eg. if you're running your MAUI app on Windows, which would use WinUI 3 as backend, then that'd have the same problem we already mentioned, and it wouldn't work. Same if MAUI happened to get a WPF backend, that'd also not work with this, for instance. |
OK. Thank you for the clarifications! |
Overview
Request to include the
ObservableRangeCollection
, an updatedObservableCollection
which raises the notification once rather than raising it for every item and it will not be part of the CommunityToolkit.Maui as this MVVM Toolkit is the recommended way to move forward for all MVVM-based applications.And this type provides a multitude of methods to work on a range of items.
API breakdown
https://github.com/xamarin/XamarinCommunityToolkit/blob/main/src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/ObservableRangeCollection.shared.cs
Usage example
Breaking change?
No
Alternatives
As of now copy and paste the code into all available projects.
Additional context
This is pretty useful for lazy loading such as the Pagination of a collection.
Query the items from the remote API via network calls or from the local databases such as SQLite.
Help us help you
No, just wanted to propose this
The text was updated successfully, but these errors were encountered: