How would I convert the following multiple foreach
to LINQ?
foreach (var resourceOne in resourceList)
{
string s = (string)resourceOne;
foreach (Control c in gridBtn.Children)
{
if (c.GetType() == typeof(ToggleButton))
{
int TagPlusOne = Convert.ToInt32(c.Tag) + 1;
string PaddedResult = TagPlusOne.ToString().PadLeft(3, '0');
if (PaddedResult == s)
{
((ToggleButton)c).BorderBrush = Brushes.Red;
((ToggleButton)c).BorderThickness = new Thickness(3, 3, 3, 3);
}
}
}
}