Сейчас реализовано так (ControlType - enum value):
private readonly ControlType[] _types;
private ComboBoxItem[] GetItems()
{
ComboBoxItem[] items = new ComboBoxItem[_types.Length];
int i = 0;
foreach (ControlType type in _types)
{
ComboBoxItem item = new ComboBoxItem(type.ToString());
items[i++] = item;
}
return items;
}
Как-то громоздко, можно же, наверно, и в одну строчку это сделать с помощью LINQ? Плюс если можно, то как в этом случае будет с производительностью?