[Proposal] ObservableRangeCollection
See original GitHub issueObservableRangeCollection
- Proposed
- Prototype: Not Started
- Implementation: Not Started
- iOS Support
- Android Support
- macOS Support
- Windows Support
- Unit Tests: Not Started
- Sample: Not Started
- Documentation: Not Started
Summary
Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed
Detailed Design
public class ObservableRangeCollection<T> : ObservableCollection<T>
{
public ObservableRangeCollection() : base()
{
}
public ObservableRangeCollection(IEnumerable<T> collection) : base(collection)
{
}
public void AddRange(IEnumerable<T> collection, NotifyCollectionChangedAction notificationMode = NotifyCollectionChangedAction.Add);
public void RemoveRange(IEnumerable<T> collection, NotifyCollectionChangedAction notificationMode = NotifyCollectionChangedAction.Reset);
public void Replace(T item);
public void ReplaceRange(IEnumerable<T> collection);
}
Usage Syntax
XAML Usage
N/A
C# Usage
public ObservableRangeCollection<int> collection = new();
public void AddNumbers(int count)
{
var startingNumber = collection.Length;
collection.AddRange(Enumerable.Range(startingNumber, count));
}
Drawbacks
We are deferring all MVVM components to the MVVM Toolkit, keeping the .NET MAUI Community Toolkit focused on .NET MAUI-specific tools.
Alternatives
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
ObservableRangeCollection<T> Class
Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.
Read more >ObservableCollection and Item PropertyChanged
If I have an observable collection that is a collection of "PersonNames" as in the msdn example (http: //msdn.microsoft.com/en-us/library/ ...
Read more >Observable Collection | WPF Controls
The SchedulerViewModel class exposes the generic collections of these objects (the ObservableCollection<ModelAppointment> and the ObservableCollection< ...
Read more >Infinite Scrolling with Incremental Data Loading in Xamarin. ...
CollectionView has the built-in ability to fetch additional data when the user scrolls through the content already loaded.
Read more >ListView binding to ObservableCollection does not update ...
When my task returns with the collection i add them to the observable collection but this does not update the UI for some...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agreed.
There are efforts being made internally to still sneak it into .NET 7.
But if it were to be added to a Community Toolkit, then https://github.com/CommunityToolkit/dotnet would be the best toolkit for it.
@kkppstudios you can copy the implementation to your code and use it there