title: WPF - How to combine DataTrigger and Trigger?
body: <blockquote>
    <p><strong>NOTE</strong> I have asked the related question: <a href="https://stackoverflow.com/questions/1679391/wpf-how-to-combine-datatrigger-and-eventtrigger">How to combine DataTrigger and EventTrigger?</a></p>
  </blockquote>
  
  <p>I have a list box containing several items.  The item's class implements <code>INotifyPropertyChanged</code> and has a property <code>IsAvailable</code>.  I use that property to indicate unavailable options in the list using a different colour.</p>
  
  <p>However, if a selected item is not available, then the foreground colour should be red.</p>
  
  <pre><code>&lt;ListBox&gt;
    &lt;ListBox.Resources&gt;
      &lt;DataTemplate DataType="{x:Type local:InstitutionViewModel}"&gt;
        &lt;TextBlock Name="Name" Text="{Binding Name}"/&gt;
        &lt;DataTemplate.Triggers&gt;
          &lt;DataTrigger Binding="{Binding IsAvailable}" Value="False"&gt;
            &lt;Setter TargetName="Name" Property="Foreground" Value="#888"/&gt;
          &lt;/DataTrigger&gt;
        &lt;/DataTemplate.Triggers&gt;
      &lt;/DataTemplate&gt;
    &lt;/ListBox.Resources&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>I use the above data trigger to grey out unavailable items.</p>
  
  <p>The problem I'm facing is that the fact that the item is selected has nothing to do with the underlying data to which the template is bound.  What I really want is some kind of multi-trigger that supports both a regular <code>Trigger</code> on a dependency property (<code>ListBoxItem.IsSelected</code>) along with a <code>DataTrigger</code> on the bound data item.</p>
  
  <p>Can this be done without introducing the concept of selection into my view model?</p>
  
  <p><em>For anyone wondering why I do not disable unavailable items, understand that it is a requirement of the application that unavailable options may be selected.  There are actually a few list boxes, and selection in one effects what's available in the others.  I cannot disable the items as the user would not be able to change their minds or explore different combinations if items were disabled based upon earlier selections.</em></p>