Question: Is there a way to add buttons from a specific wrappanel to an array or list in code?
I tried the code below, but it doesn't work:

```
foreach(Button b in nameOfWrappanel)
{
    list.Add(b);
}

```

Answer: 
You have to specify wrappanel.children to access its child.

```
foreach (Button b in nameOfWrappanel.Children)
{
    list.Add(b);
}

```
Since the `Children` property of a `Panel` returns a `UIElementCollection` that may contain any type of `UIElement` objects, you could use the `OfType` LINQ extension method to only retrive the `Button` elements:

```
foreach (Button b in nameOfWrappanel.Children.OfType<Button>())
{
    list.Add(b);
}

```