title: Prevent Listbox selection
body: <p>I have a multi selection listbox where only certain combinations of items are permitted in selection.
  How can I deny certain selection? 
  The listbox is bound to view model. I thought I could do it in property setter but is doesn't work.</p>
  
  <p>XAML</p>
  
  <pre><code>&lt;i:Interaction.Triggers&gt;
      &lt;i:EventTrigger EventName="SelectionChanged"&gt;
          &lt;i:ChangePropertyAction TargetObject="{Binding Mode=OneWay}" PropertyName="SelectedItems" Value="{Binding Path=SelectedItems, ElementName=TranslatorsListView}"/&gt;
      &lt;/i:EventTrigger&gt;
  &lt;/i:Interaction.Triggers&gt;
  </code></pre>
  
  <p>In View Model</p>
  
  <pre><code>public System.Collections.IList SelectedItems 
  {
      get
      {
          return SelectedModels;
      }
      set 
      { 
          //what here?
      }
  }  
  </code></pre>
  
  <p>Edit:
  I should have made clear, that I'm using multi selection. That's why I'm using interaction triggers and not just binding to SelectedItem. The linked answer is for single selection.</p>