I’m trying to address all items of a list without a forEach-loop.
For example:
ColorTextBlocks = new List<TextBlock>()
{
tb1,
tb2,
tb3,
tb4,
tb5,
tb6
}
Is it possible to change the foreground of all items in one line?
Sure:
You can also do:
But why “in one line”? A foreach loop is traditionally more readable that Linq queries…