Question: ```
foreach (var item in mainCanvas.Children)
{
    if (item is Button)
    {
        (item as Button).Content = "this is a button";
    }                
}

```

Can I use LINQ or other feature of .NET 4 to be more concise (maybe performant)?

Answer: 
One line should do it

```
mainCanvas.Children.OfType<Button>.ToList().ForEach(b => b.Content = "this is a button");

```
Not that it's particularly superior, but there is something nice about this syntax:

Using LINQ and the Microsoft [ReactiveExtensions](http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx) framework,

```
mainCanvas.Children
   .OfType<Button>()
   .Do(b => b.Content = "I'm a button!")
   .Run();

```