Why can't Remove all Childrens!

Hi I reproduce a problem that I have in my app. Here is the project. I’m trying to Remove all the Childrens of certain Class from my StackPanel. But I don’t know why only remove some of them…

If I press Populate the Elements appear but if I press Clear only some of them get Remove. I need to press Clearmany times to remove all of them…

How can achieve this?

Thanks!

I solved with MyStackPanel.RemoveAllChildren<MyClass>();