mirror of
https://github.com/chylex/.NET-Community-Toolkit.git
synced 2025-04-10 11:15:45 +02:00
Add IReadOnlyObservableGroup<out TKey>
This commit is contained in:
parent
e4a105f4f8
commit
257250dc70
CommunityToolkit.Mvvm/Collections
@ -0,0 +1,18 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace CommunityToolkit.Mvvm.Collections;
|
||||
|
||||
/// <summary>
|
||||
/// An interface for a grouped collection of items.
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey">The type of the group key.</typeparam>
|
||||
public interface IReadOnlyObservableGroup<out TKey> : IReadOnlyObservableGroup
|
||||
where TKey : notnull
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the key for the current collection.
|
||||
/// </summary>
|
||||
new TKey Key { get; }
|
||||
}
|
@ -17,7 +17,7 @@ namespace CommunityToolkit.Mvvm.Collections;
|
||||
/// <typeparam name="TKey">The type of the group key.</typeparam>
|
||||
/// <typeparam name="TValue">The type of the items in the collection.</typeparam>
|
||||
[DebuggerDisplay("Key = {Key}, Count = {Count}")]
|
||||
public class ObservableGroup<TKey, TValue> : ObservableCollection<TValue>, IGrouping<TKey, TValue>, IReadOnlyObservableGroup
|
||||
public class ObservableGroup<TKey, TValue> : ObservableCollection<TValue>, IGrouping<TKey, TValue>, IReadOnlyObservableGroup<TKey>
|
||||
where TKey : notnull
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -13,7 +13,7 @@ namespace CommunityToolkit.Mvvm.Collections;
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey">The type of the group key.</typeparam>
|
||||
/// <typeparam name="TValue">The type of the items in the collection.</typeparam>
|
||||
public sealed class ReadOnlyObservableGroup<TKey, TValue> : ReadOnlyObservableCollection<TValue>, IGrouping<TKey, TValue>, IReadOnlyObservableGroup
|
||||
public sealed class ReadOnlyObservableGroup<TKey, TValue> : ReadOnlyObservableCollection<TValue>, IGrouping<TKey, TValue>, IReadOnlyObservableGroup<TKey>
|
||||
where TKey : notnull
|
||||
{
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user