Welcome to mirror list, hosted at ThFree Co, Russian Federation.

IGroupingList.cs « Xamarin.PropertyEditing - github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ee7cdb4c061cd69a710accce6a511946f5230b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;

namespace Xamarin.PropertyEditing
{
	internal interface IGroupingList<TKey, TElement>
		: IGrouping<TKey, TElement>, IReadOnlyList<TElement>
	{
	}

	internal class ObservableGrouping<TKey, TElement>
		: ObservableCollectionEx<TElement>, IGroupingList<TKey, TElement>
	{
		public ObservableGrouping (TKey key)
		{
			Key = key;
		}

		public ObservableGrouping (IGrouping<TKey, TElement> grouping)
		{
			Key = grouping.Key;
			AddRange (grouping);
		}

		public TKey Key
		{
			get;
		}
	}
}