Collection<T> and ObservableCollection<T> do not support ranges
# Update 10/04/2018 @ianhays and I discussed this and we agree to add this 6 APIs for now: ```cs // Adds a range to the end of the collection. // Raises CollectionChanged (NotifyCollectionChangedAction.Add) public void AddRange(IEnumerable<T> collection) => InsertItemsRange(0, collection); // Inserts a range // Raises CollectionChanged (NotifyCollectionChangedAction.Add) public void InsertRange(int index, IEnumerable<T> collection) => InsertItemsRange(index, collection); // Removes a range. // Raises CollectionChanged (NotifyCollectionChangedAction.Remove) public void RemoveRange(int index, int count) => RemoveItemsRange(index, count); // Will allow to replace a range with fewer, equal, or more items. // Raises CollectionChanged (NotifyCollectionChangedAction.Replace) public void ReplaceRange(int index, int count, IEnumerable<T> collection) { RemoveItemsRange(index, count); InsertItemsRange(index, collection); } #region virtual methods protected virtual void InsertItemsRange(int index, IEnumerable<T> collection); protected virtual void RemoveItemsRange(int index, int count); #endregion ``` As those are the most commonly used across collection types and the `Predicate` ones can be achieved through Linq and seem like edge cases. To answer @terrajobst questions: > Should the methods be virtual? If no, why not? If yes, how does eventing work and how do derived types work? Yes, we woul
Posted by robertmclaws on Aug 13, 2016, 6:31 AM
Tags
Related issues
- some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
- I think of this as the kiosk economy.
- What a goofy comment.
- There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
- Compose support in WSLc
- [RFC] Roadmap to v2.0
Raise real-world problems, find people facing the same issue, and discuss solutions.5,000 issues0 comments
support (Other)
some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
I think of this as the kiosk economy.
What a goofy comment.
There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
Compose support in WSLc
[RFC] Roadmap to v2.0
[Feature]: Add TurboQuant Support for KV Cache Quantization
Support for AGENTS.md and .agents/skills/, the community has been asking since August 2025
Collection<T> and ObservableCollection<T> do not support ranges
# Update 10/04/2018 @ianhays and I discussed this and we agree to add this 6 APIs for now: ```cs // Adds a range to the end of the collection. // Raises CollectionChanged (NotifyCollectionChangedAction.Add) public void AddRange(IEnumerable<T> collection) => InsertItemsRange(0, collection); // Inserts a range // Raises CollectionChanged (NotifyCollectionChangedAction.Add) public void InsertRange(int index, IEnumerable<T> collection) => InsertItemsRange(index, collection); // Removes a range. // Raises CollectionChanged (NotifyCollectionChangedAction.Remove) public void RemoveRange(int index, int count) => RemoveItemsRange(index, count); // Will allow to replace a range with fewer, equal, or more items. // Raises CollectionChanged (NotifyCollectionChangedAction.Replace) public void ReplaceRange(int index, int count, IEnumerable<T> collection) { RemoveItemsRange(index, count); InsertItemsRange(index, collection); } #region virtual methods protected virtual void InsertItemsRange(int index, IEnumerable<T> collection); protected virtual void RemoveItemsRange(int index, int count); #endregion ``` As those are the most commonly used across collection types and the `Predicate` ones can be achieved through Linq and seem like edge cases. To answer @terrajobst questions: > Should the methods be virtual? If no, why not? If yes, how does eventing work and how do derived types work? Yes, we woul
Comments (0)
No comments yet. Start the discussion.