title: Can't get items in a ListView cross-thread
body: <p>My <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx" rel="nofollow">background worker</a> needs to iterate through each item in a <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview%28v=vs.110%29.aspx" rel="nofollow">ListView</a>. However I can't do this:</p>
  
  <pre><code>foreach (ListViewItem Item in List.Items)
  </code></pre>
  
  <p>because it's a cross thread operation.</p>
  
  <p>I also can't put the items in a <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.listviewitemcollection.aspx" rel="nofollow">ListView.ListViewItemCollection</a> and make the background worker read from that. This is still trying to access the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview%28v=vs.110%29.aspx" rel="nofollow">ListView</a> and creating a cross thread operation.</p>
  
  <p>How can I make the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview%28v=vs.110%29.aspx" rel="nofollow">ListView</a>'s items available to the background worker without putting them in a variable somewhere?</p>