I have the following code to return items from Dictionary<int, string> buttonGroups
where the values match certain string.
public static void RemoveColorRange(List<Button> buttons, int[] matches)
{
Dictionary<int, string> buttonGroups = new Dictionary<int, string>();
foreach (Button btn in buttons)
{
if ((int)btn.Tag == matches[0] || (int)btn.Tag == matches[1])
continue;
SolidColorBrush brush = (SolidColorBrush)btn.Background;
Color color = new Color();
color = brush.Color;
buttonGroups.Add((int)btn.Tag, closestColor(color));
}
var buttonMatches = buttonGroups.Where(x => x.Value == 'somestring');
}
However it returns the following type instead of a dictionary object. I can't seem to retrieve any value from buttonMatches. What am I missing?
{System.Linq.Enumerable.WhereEnumerableIterator<System.Collections.Generic.KeyValuePair<int,string>>}