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 2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
+ using System . Collections ;
6
+ using System . Collections . Specialized ;
5
7
using System . ComponentModel ;
6
8
7
9
namespace CommunityToolkit . Mvvm . Collections ;
8
10
9
11
/// <summary>
10
12
/// An interface for a grouped collection of items.
11
13
/// </summary>
12
- public interface IReadOnlyObservableGroup : INotifyPropertyChanged
14
+ public interface IReadOnlyObservableGroup : INotifyPropertyChanged , INotifyCollectionChanged , IEnumerable
13
15
{
14
16
/// <summary>
15
17
/// Gets the key for the current collection.
@@ -20,4 +22,12 @@ public interface IReadOnlyObservableGroup : INotifyPropertyChanged
20
22
/// Gets the number of items currently in the grouped collection.
21
23
/// </summary>
22
24
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 ; }
23
33
}
Original file line number Diff line number Diff line change @@ -71,4 +71,7 @@ public TKey Key
71
71
72
72
/// <inheritdoc/>
73
73
object IReadOnlyObservableGroup . Key => Key ;
74
+
75
+ /// <inheritdoc/>
76
+ object ? IReadOnlyObservableGroup . this [ int index ] => this [ index ] ;
74
77
}
Original file line number Diff line number Diff line change @@ -41,4 +41,7 @@ public ReadOnlyObservableGroup(ObservableGroup<TKey, TValue> group)
41
41
42
42
/// <inheritdoc/>
43
43
object IReadOnlyObservableGroup . Key => Key ;
44
+
45
+ /// <inheritdoc/>
46
+ object ? IReadOnlyObservableGroup . this [ int index ] => this [ index ] ;
44
47
}
You can’t perform that action at this time.
0 commit comments