title: C# DragDrop object with children results in System.InvalidOperationException
body: <p>I have implemented Drag and Drop on a treeview in WPF, which works as intended.  However, it is only adding the root element (the one dragged over) to the data object holding the values of the tree, but adding all of the children (and their children, and so on) to the visual tree.</p>
  
  <p>Here is my first attempt at adding the children to the data object (this should add the first sub-level):</p>
  
  <pre><code>public void DropNewProjectOrganLocation(OrganLocationViewModel organLocation)
      {
          _projOrganLocation.Add(organLocation);
          ObservableCollection&lt;OrganLocationViewModel&gt; subOrgans = organLocation.SubOrganLocations;
          foreach (OrganLocationViewModel node in subOrgans)
          {
                  organLocation.SubOrganLocations.Add(node);
                  node.ParentOrganLocation = organLocation;
  
          }
      }
  </code></pre>
  
  <p>Now when I drag and drop an item that has no children, it works as intended (and is added to the object tree as well as the visual tree).  However, when I try to drag and drop an item that has any number of children, it loops through the <code>foreach</code> code block, then when it finishes and tries to complete the dragdrop, it errors out with this error message:</p>
  
  <p><code>An unhandled exception of type 'System.InvalidOperationException' occurred in PresentationCore.dll</code>
  <code>Additional information: Collection was modified; enumeration operation may not execute</code></p>
  
  <p>and I'm using the <code>DoDragDrop</code> method from <code>System.Windows.DragDrop</code>
  Here is the line that causes the error:
  <code>System.Windows.DragDrop.DoDragDrop(m_DragInfo.VisualSource, data, m_DragInfo.Effects);</code></p>
  
  <p>Does anyone know how I can recursively add children nodes to the object tree?</p>