I need a type that keeps track of a collection and the selected value in a collection, similar to what a list box would do. Is there an existing (non-gui control) collection for this? I know it’s fairly simple but I would rather use Microsoft’s provided type if there is one.
Basically, this is what I want:
interface ISelectionList<T>
{
T Selected
{
get;
set;
}
IList<T> Values
{
}
}
No, there is nothing like that in the .NET framework.
I would like to suggest that you build your interface a bit differently to leverage the power of inherited interfaces.
Try something like this:
This will allow you to still use your
ISelectionList<T>as anIList<T>where needed.