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");

```
See if there is an `OfType<T>` extension.

```
foreach (var item in mainCanvas.Children.OfType<Button>()) 
{ 
    item.Content = "this is a button"; 
}

```

If not, you can use:

```
foreach (var item in mainCanvas.Children.Where(item=>item is Button).Cast<Button>()) 
{ 
    item.Content = "this is a button"; 
}

```