title: Managing multiple selections with MVVM
body: <p>On my journey to learning MVVM I've established some basic understanding of WPF and the ViewModel pattern. I'm using the following abstraction when providing a list and am interested in a single selected item.</p>
  
  <pre><code>public ObservableCollection&lt;OrderViewModel&gt; Orders { get; private set; }
  public ICollectionView OrdersView
  {
      get
      {
          if( _ordersView == null )
              _ordersView = CollectionViewSource.GetDefaultView( Orders );
          return _ordersView;
      }
  }
  private ICollectionView _ordersView;
  
  public OrderViewModel CurrentOrder 
  { 
      get { return OrdersView.CurrentItem as OrderViewModel; } 
      set { OrdersView.MoveCurrentTo( value ); } 
  }
  </code></pre>
  
  <p>I can then bind the OrdersView along with supporting sorting and filtering to a list in WPF:</p>
  
  <pre><code>&lt;ListView ItemsSource="{Binding Path=OrdersView}" 
            IsSynchronizedWithCurrentItem="True"&gt;
  </code></pre>
  
  <p>This works really well for single selection views. But I'd like to also support multiple selections in the view and have the model bind to the list of selected items. </p>
  
  <p>How would I bind the ListView.SelectedItems to a backer property on the ViewModel?</p>