Drag and Drop Custom Control Isn't working <p>I have built a custom <code>ListView</code> to allow me to drag and drop. with some help from other questions and blog post i have gotten this far. </p> <p>I am using <code>MVVM</code> in the implementation of the <code>UserControl</code> but while building the actual Custom <code>ListView</code> i am just using the code behind. as i thought this would be easier.</p> <p>How can I implement code below to get to add to ViewModel ICollection?</p> <p><strong>update:</strong></p> <p>please note that I think that the reason this is happening is because I am trying to add an <code>object</code> to <code>ObservableCollection&lt;person&gt;()</code>;</p> <p>exception:</p> <blockquote> <p>Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead.</p> </blockquote> <p>XAML: Implementation:</p> <pre><code>&lt;controls:DragNDropListView x:Name="ListView" ItemsSource="{Binding Persons}" DragDropEffects="Copy" DisplayMemberPath="Name"&gt;&lt;/controls:DragNDropListView&gt; &lt;controls:DragNDropListView x:Name="ListView1" Grid.Column="1" ItemsSource="{Binding Persons1}" DisplayMemberPath="Name" DragDropEffects="Copy"/&gt; </code></pre> <p>ViewModel:</p> <pre><code>public class ViewModel { public ViewModel() { Persons = new ObservableCollection&lt;Person&gt;(); Persons1 = new ObservableCollection&lt;Person&gt;(); Persons.Clear(); Persons1.Clear(); foreach (var person in Data.People().ToList()) { Persons.Add(person); Persons1.Add(person); } } public ObservableCollection&lt;Person&gt; Persons { get; set; } public ObservableCollection&lt;Person&gt; Persons1 { get; set; } } </code></pre> <p>Drag code:</p> <pre><code>private void OnMouseMove(object sender, MouseEventArgs e) { Point mousePos = e.GetPosition(null); Vector diff = _startPoint - mousePos; if (e.LeftButton == MouseButtonState.Pressed &amp;&amp; (Math.Abs(diff.X) &gt; SystemParameters.MinimumHorizontalDragDistance || Math.Abs(diff.Y) &gt; SystemParameters.MinimumVerticalDragDistance)) { if (ListView != null) { ListViewItem listViewItem = FindAnchestor&lt;ListViewItem&gt;((DependencyObject)e.OriginalSource); if (listViewItem != null) { var item = ListView.ItemContainerGenerator.ItemFromContainer(listViewItem); //NOTE:this is an object not a Person like observeablecollection in ViewModel. DataObject dragData = new DataObject("myFormat", item); DragDrop.DoDragDrop(listViewItem, dragData, DragDropEffects); } } } } </code></pre> <p>Drop code that is throwing exception:</p> <pre><code>private void OnDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent("myFormat")) { var item = e.Data.GetData("myFormat"); if (item != null) { Items.Add(item);//this is where it throws exception } } } </code></pre>