title: WPF binding based on comparison
body: <p>There is a relatively simple thing I'm trying to achieve but I'm unsure how to do it. Basically, I have a CLR class as follows:</p>
  
  <pre><code>class SomeClass
  {
      public SomeEnum Status;
  }
  
  public enum SomeEnum { One, Two, Three };
  </code></pre>
  
  <p>I've got a DataGrid that I'm binding an <code>ObservableCollection&lt;SomeClass&gt;</code> programmatically through the code-behind. In this DataGrid I have a <code>DataGridTemplateColumn</code> containing two buttons, as follows:</p>
  
  <pre><code>&lt;toolkit:DataGridTemplateColumn Header="Actions"&gt;
      &lt;toolkit:DataGridTemplateColumn.CellTemplate&gt;
      &lt;DataTemplate&gt;
      &lt;StackPanel Orientation="Horizontal"&gt;
          &lt;Button Content="ActionOne" /&gt;
          &lt;Button Content="ActionTwo" /&gt;
      &lt;/StackPanel&gt;
      &lt;/DataTemplate&gt;
  &lt;/toolkit:DataGridTemplateColumn.CellTemplate&gt;
  &lt;/toolkit:DataGridTemplateColumn&gt;
  </code></pre>
  
  <p>What I want to do is bind the IsEnabled property of these buttons to a comparison based on the value of {Binding Path=Status}. For example, in pseudocode:</p>
  
  <pre><code>ActionOne.IsEnabled = BoundValue.Status != SomeEnum.Two
  ActionTwo.IsEnabled = BoundValue.Status == SomeEnum.One || BoundValue.Status == SomeEnum.Two
  </code></pre>
  
  <p>Is there anyway to do this in XAML? The alternative would be just to write a value converter for each button, but since the content and other details of the button may vary, too, I don't want to end up writing like 6 value converters.</p>
  
  <p>Cheers!</p>