File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 22// The .NET Foundation licenses this file to you under the MIT license.
33// See the LICENSE file in the project root for more information.
44
5+ using System . Collections ;
6+ using System . Collections . Specialized ;
57using System . ComponentModel ;
68
79namespace CommunityToolkit . Mvvm . Collections ;
810
911/// <summary>
1012/// An interface for a grouped collection of items.
1113/// </summary>
12- public interface IReadOnlyObservableGroup : INotifyPropertyChanged
14+ public interface IReadOnlyObservableGroup : INotifyPropertyChanged , INotifyCollectionChanged , IEnumerable
1315{
1416 /// <summary>
1517 /// Gets the key for the current collection.
@@ -20,4 +22,12 @@ public interface IReadOnlyObservableGroup : INotifyPropertyChanged
2022 /// Gets the number of items currently in the grouped collection.
2123 /// </summary>
2224 int Count { get ; }
25+
26+ /// <summary>
27+ /// Gets the element at the specified index in the current collection.
28+ /// </summary>
29+ /// <param name="index">The zero-based index of the element to get.</param>
30+ /// <returns>The element at the specified index in the read-only list.</returns>
31+ /// <exception cref="System.ArgumentOutOfRangeException">Thrown if the index is out of range.</exception>
32+ object ? this [ int index ] { get ; }
2333}
Original file line number Diff line number Diff line change @@ -71,4 +71,7 @@ public TKey Key
7171
7272 /// <inheritdoc/>
7373 object IReadOnlyObservableGroup . Key => Key ;
74+
75+ /// <inheritdoc/>
76+ object ? IReadOnlyObservableGroup . this [ int index ] => this [ index ] ;
7477}
Original file line number Diff line number Diff line change @@ -41,4 +41,7 @@ public ReadOnlyObservableGroup(ObservableGroup<TKey, TValue> group)
4141
4242 /// <inheritdoc/>
4343 object IReadOnlyObservableGroup . Key => Key ;
44+
45+ /// <inheritdoc/>
46+ object ? IReadOnlyObservableGroup . this [ int index ] => this [ index ] ;
4447}
You can’t perform that action at this time.
0 commit comments