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

Commit 14addca

Browse files
committed
Refactor code.
1 parent 83d80cc commit 14addca

File tree

4 files changed

+674
-98
lines changed

4 files changed

+674
-98
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# WpfObservableRangeCollection
22

3-
Provides ObservableRangeCollection and its WPF version, including AddRange, RemoveRange, Replace/ReplaceRange methods for bulk operation, but only update the notification once.
3+
Provides ObservableRangeCollection and its WPF version, including AddRange, InsertRange, RemoveRange, Replace/ReplaceRange methods for bulk operation, but only update the notification once.
44

55
---
66

@@ -10,7 +10,7 @@ Provides ObservableRangeCollection and its WPF version, including AddRange, Remo
1010

1111
## Classes
1212
- `ObservableRangeCollection`: Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.
13-
> 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)
13+
> Forked from [weitzhandler/rangeobservablecollection-cs](https://gist.github.com/weitzhandler/65ac9113e31d12e697cb58cd92601091#file-rangeobservablecollection-cs)
1414
1515
- `WpfObservableRangeCollection`: Wpf version of ObservableRangeCollection with CollectionView support.
1616
> Forked from [weitzhandler/wpfobservablerangecollection-cs](https://gist.github.com/weitzhandler/65ac9113e31d12e697cb58cd92601091#file-wpfobservablerangecollection-cs)
@@ -20,13 +20,14 @@ See [ObservableCollection Doesn't support AddRange method, so I get notified for
2020

2121
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:
2222
- System.NotSupportedException: Range actions are not supported.
23-
- System.InvalidOperationException: The "2" index in the collection change event is not valid for collections of size "1".
23+
- System.InvalidOperationException: The "x" index in the collection change event is not valid for collections of size "y".
2424
- More? I'm not sure. I forgot.
2525

2626
If the `NotSupportedException` still occurred, try using `BindingOperations.EnableCollectionSynchronization(IEnumerable, Object)`.
2727

28-
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.
28+
In the end, I chose `weitzhandler/RangeObservableCollection` and `weitzhandler/WpfObservableRangeCollection` and made slight changes to the code, and finally, I didn't encounter any problems, for now.
2929

3030
## Seealso
31-
- [weitzhandler/RangeObservableCollection.cs - Gist](https://gist.github.com/weitzhandler/65ac9113e31d12e697cb58cd92601091)
32-
- [My comment](https://gist.github.com/weitzhandler/65ac9113e31d12e697cb58cd92601091?permalink_comment_id=4634920#gistcomment-4634920)
31+
- [Cysharp/ObservableCollections](https://github.com/Cysharp/ObservableCollections)
32+
- [ENikS/ObservableCollectionEx](https://github.com/ENikS/ObservableCollectionEx)
33+
- [XamarinCommunityToolkit/src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/ObservableRangeCollection.shared.cs](https://github.com/xamarin/XamarinCommunityToolkit/blob/main/src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/ObservableRangeCollection.shared.cs)

0 commit comments

Comments
 (0)