Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit be5295b

Browse files
Update README.md
1 parent ea40c9a commit be5295b

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1-
# WpfObservableRangeCollection
1+
# WpfObservableRangeCollection
2+
3+
Provides ObservableRangeCollection and its WPF version, including AddRange, RemoveRange, Replace/ReplaceRange methods for bulk operation, but only update the notification once.
4+
5+
---
6+
## Classes
7+
- `ObservableRangeCollection`: Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.
8+
> Forked from [XamarinCommunityToolkit/src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/ObservableRangeCollection.shared.cs](https://github.com/xamarin/XamarinCommunityToolkit/blob/main/src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/ObservableRangeCollection.shared.cs)
9+
10+
- `WpfObservableRangeCollection`: Wpf version of ObservableRangeCollection with CollectionView support.
11+
> Forked from [weitzhandler/wpfobservablerangecollection-cs](https://gist.github.com/weitzhandler/65ac9113e31d12e697cb58cd92601091#file-wpfobservablerangecollection-cs)
12+
13+
## Why WpfObservableRangeCollection?
14+
See [ObservableCollection Doesn't support AddRange method, so I get notified for each item added, besides what about INotifyCollectionChanging? - StackOverflow](https://stackoverflow.com/q/670577/4380178)
15+
16+
I've searched the web for some ObservableCollections that have *Range methods, but they all raise various exceptions(and some strange problems) in certain specific situations:
17+
- System.NotSupportedException: Range actions are not supported.
18+
- System.InvalidOperationException: The "2" index in the collection change event is not valid for collections of size "1".
19+
- More? I'm not sure. I forgot.
20+
21+
In the end, I chose `XamarinCommunityToolkit/ObservableRangeCollection` and `weitzhandler/WpfObservableRangeCollection` and made slight changes to the code, and finally, I didn't encounter any problems, for now.
22+
23+
## Seealso
24+
- [weitzhandler/RangeObservableCollection.cs - Gist](https://gist.github.com/weitzhandler/65ac9113e31d12e697cb58cd92601091)
25+
- [My comment](https://gist.github.com/weitzhandler/65ac9113e31d12e697cb58cd92601091?permalink_comment_id=4634920#gistcomment-4634920)

0 commit comments

Comments
 (0)