title: WPF M-V-VM: Get selected items from a ListCollectionView?
body: <p>I've got a WPF app using the Model-View-ViewModel pattern.<br>
  In my ViewModel I've got a ListCollectionView to keep a list of items.<br>
  This ListCollectionView is bound to a ListBox in my View.  </p>
  
  <pre><code>&lt;ListBox Grid.Row="1" ItemsSource="{Binding Useragents}" SelectionMode="Multiple"/&gt;
  </code></pre>
  
  <p>The ListBox has SelectionMode=Multiple, so you can select more items at one time. Now the ViewModel needs to know which items has been selected.</p>
  
  <p>The problem is: in the View-Model-ViewModel pattern the ViewModel has no access to the View, so I can't just ask the ListBox which items has been selected. All I have is the ListCollectionView, but I can't find a way to find which items has been selected in there.</p>
  
  <p>So how do I find which items has been selected in the ListBox? Or a trick to achieve this (maybe bind something to a Boolean 'IsSelected' in my items? But what? How?)</p>
  
  <p>Maybe someone who is using this pattern, too, can help me here?</p>