I'm trying to remove all children (and sub-children) of a Grid
in WPF (I'm really new to the whole WPF business). Is there a good way of doing it programmatically? I need to do this so that I could leave an empty canvas (Grid
) at one point and draw other stuff on it.
Asked
Active
Viewed 9,806 times
14

Phonon
- 12,549
- 13
- 64
- 114
1 Answers
29
hmmm
myGrid.Children.Clear();
?

David
- 6,014
- 4
- 39
- 55
-
Can't believe I missed that. = ) I was looking for a method of `Grid`, not `Grid.Children` – Phonon Apr 20 '11 at 15:50
-
he he he... often, the most obvious things are invisible even to the trained eye ;) – David Apr 20 '11 at 16:06