33// See the LICENSE file in the project root for more information.
44
55using System ;
6- using System . Collections . Generic ;
76using System . Collections . ObjectModel ;
87using System . Collections . Specialized ;
98using System . Diagnostics ;
@@ -23,18 +22,18 @@ public sealed class ReadOnlyObservableGroupedCollection<TKey, TValue> : ReadOnly
2322 /// Initializes a new instance of the <see cref="ReadOnlyObservableGroupedCollection{TKey, TValue}"/> class.
2423 /// </summary>
2524 /// <param name="collection">The source collection to wrap.</param>
26- public ReadOnlyObservableGroupedCollection ( ObservableGroupedCollection < TKey , TValue > collection )
27- : this ( collection . Select ( static g => new ReadOnlyObservableGroup < TKey , TValue > ( g ) ) )
25+ public ReadOnlyObservableGroupedCollection ( ObservableCollection < ObservableGroup < TKey , TValue > > collection )
26+ : base ( new ObservableCollection < ReadOnlyObservableGroup < TKey , TValue > > ( collection . Select ( static g => new ReadOnlyObservableGroup < TKey , TValue > ( g ) ) ) )
2827 {
29- ( ( INotifyCollectionChanged ) collection ) . CollectionChanged += OnSourceCollectionChanged ;
28+ collection . CollectionChanged += OnSourceCollectionChanged ;
3029 }
3130
3231 /// <summary>
3332 /// Initializes a new instance of the <see cref="ReadOnlyObservableGroupedCollection{TKey, TValue}"/> class.
3433 /// </summary>
35- /// <param name="collection">The initial data to add in the grouped collection .</param>
36- public ReadOnlyObservableGroupedCollection ( IEnumerable < ReadOnlyObservableGroup < TKey , TValue > > collection )
37- : base ( new ObservableCollection < ReadOnlyObservableGroup < TKey , TValue > > ( collection ) )
34+ /// <param name="collection">The source collection to wrap .</param>
35+ public ReadOnlyObservableGroupedCollection ( ObservableCollection < ReadOnlyObservableGroup < TKey , TValue > > collection )
36+ : base ( collection )
3837 {
3938 }
4039
0 commit comments