title: How to bind ListBoxItem.IsSelected to boolean data property
body: <p>I have a WPF ListBox in Extended SelectionMode. </p>
  
  <p>What I need to do is bind the ListBox to an observable collection of a data item class, which is easy, but essentially, bind the <code>IsSelected</code> status of each ListBoxItem to a boolean property in the respective data item. </p>
  
  <p>And, I need it to be two-way, so that I can populate the ListBox with selected and unselected items from the ViewModel.</p>
  
  <p>I've looked at a number of implementations but none work for me. They include:</p>
  
  <ul>
  <li>Adding a DataTrigger to the ListBoxItem's style and calling a state action change</li>
  </ul>
  
  <p>I realise this can be done in code-behind with an event handler, but given the complexity of the domain it would be horribly messy. I'd rather stick to two-way Binding with the ViewModel.</p>
  
  <p>Thanks.
  Mark</p>