title: Changing the default button (IsDefault) based on viewmodel state
body: <p>I have a dialog with one query TextBox and four Buttons.
  Depending on the result of the query one or more of the buttons are enabled.
  The TextBox is bound to a property on the VM and each of the buttons are bound to Commands on the VM</p>
  
  <p>Command.IsEnabled changes based on QueryResult</p>
  
  <pre><code>class ViewModel
  {
    public string Query {get;set;}
    public QueryResult QueryResult {get;set;}
    public ICommand FooCommand {get;set;}
    public ICommand BarCommand {get;set;}
    public ICommand BazCommand {get;set;}
    public ICommand QuxCommand {get;set;}
  }
  
  &lt;TextBox Text="{Binding Query, UpdateSourceTrigger=PropertyChanged}"/&gt;
  &lt;Button Command="{Binding FooCommand}" Content="Foo"/&gt;
  &lt;Button Command="{Binding BarCommand}" Content="Bar"/&gt;
  &lt;Button Command="{Binding BazCommand}" Content="Baz"/&gt;
  &lt;Button Command="{Binding QuxCommand}" Content="Qux"/&gt;
  </code></pre>
  
  <p>There is additional logic to determine which of the enabled buttons should be the default (visibly highlighted and activated when pressing enter)</p>
  
  <p>(Foo is always enabled, Bar is enabled if QueryResult.A is non-null, Baz is enabled if QueryResult.B is non-null etc. Multiple commands can be enabled, but there is a fixed prioritized order of preference that determines the default action) </p>
  
  <p>Bar > Baz > Foo > Qux</p>
  
  <p>My problem is how to bind the Button.IsDefault on the buttons to reflect which one should be default.</p>
  
  <p>I've thought of the following options - neither of which seems right</p>
  
  <ol>
  <li><p>Create an enum property {btn1,btn2,btn3,btn4} DefaultButton on the VM. Bind each buttons IsDefault property to this with a converter that compares its parameter to the current value</p></li>
  <li><p>Create four boolean properties on the VM IsButton1Default etc... and bind to these</p></li>
  <li><p>Something with styles+datatriggers but that makes my XAML difficult to comprehend.</p></li>
  </ol>
  
  <p>What would you do?</p>