title: Does Grid.Children.Clear() really remove all controls?
body: <p>Edit:<br>
  Simple answer: Yes, it does. I found the error, which was, that another event handler was added, everytime the <code>Combobox_SelectionChanged</code> was fired. Hence, the collection looked fine, but the <code>Items_CollectionChanged</code> was fired multiple times. Once this was fixed, everything worked fine.<br>
  End Edit.</p>
  
  <p>I've got a page with a combobox and a grid. The grid fills dynamically, when the selection in the combobox changes. I'm now observing a strange thing. When I select a value for the second time in the combobox, the childitems in the grid appear twice. I've checked the underlying collections, which look fine (i.e. only one record per item). When I jump out of the combobox_SelectionChanged method, after the <code>Grid.Children.Clear()</code> command, the screen looks fine, i.e. empty. </p>
  
  <p>My guess is, that <code>Grid.Children.Clear()</code> only removes the controls from the visual tree, but the actual controls are still hanging around. Any Ideas?</p>
  
  <pre><code>private void combobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  {
      grItems.Children.Clear();
      grItemsColumnDefinitions.Clear();
      grItemsColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(200) });
  }
  
      private void Items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
      {
  
          if (e.Action == NotifyCollectionChangedAction.Add)
          {
               grItems.Children.Add(new ChildItemControl(e.NewItems[0]));
          }
  
      } 
  </code></pre>
  
  <p>Edit: The whole thing is supposed to look like this (fictional - but hopefully understandable - example)
  <a href="https://i.stack.imgur.com/TFAjI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TFAjI.png" alt="enter image description here"></a></p>