title: Remove Items from an ObservableCollection while Looping through the Collection
body: <p>I am looping through an ObservableCollection for items that have been marked by setting a boolean to true. After doing what I need with the item I want to remove it from the OnservableCollection. I can't do that within the foreach loop, so I was thinking of making a list of all the items marked, then after the foreach loop just clear all the items from the collection at once. But I can't even get started because I don't know how to get the index of the item in the foreach loop.</p>
  
  <pre><code>            private void Upload()
              {
                  List&lt;TestResult&gt; kill;
                  foreach (var tr in TestResults)
                  {
                      if (tr.CanUpload)
                      {
                          StatusContent = "Uploading " + tr.FileName;
                          FileOps.UploadDocument(tr);
                          kill.Add(tr);
                          tr.CanUpload = false;
                          RaisePropertyChanged("TestResults");
                      }
  
                  }
                  //this doesn't work 
                  //TestResults.Remove(TestResults.Where(x =&gt; x.CanUpload == true));
               }      
  </code></pre>
  
  <p>I've tried working with what I have above, but I am missing some critical pieces to make it work right.</p>