title: Binding Button.IsEnabled to Boolean Property
body: <p>I have a boolean property that looks at several checkboxes and returns true if any of them are checked.  I would like to enable a button if any checkboxes are checked (property returns true).</p>
  
  <p>Currently I have the following:</p>
  
  <ul>
  <li><p>The data context set</p>
  
  <pre><code>public MainWindow()
  {
      InitializeComponent();
      this.DataContext = this;
  }
  </code></pre></li>
  <li><p>The button binding set</p>
  
  <pre><code>&lt;Button Name="button" IsEnabled="{Binding ButtonEnabled}"&gt;Apply&lt;/Button&gt;
  </code></pre></li>
  <li><p>The property</p>
  
  <pre><code>public bool ButtonEnabled
  {
      get
      {
          if(checkboxes_enabled)
              return true;
          else
              return false;
      }
  }
  </code></pre></li>
  </ul>
  
  <p>I have verified that the property is updating as it is supposed to, so it's narrowed down to a binding issue. I have also tried data triggers within the button:</p>
  
  <pre><code>&lt;Button Name="button" Content="Apply"&gt;
      &lt;Button.Style&gt;
          &lt;Style TargetType="{x:Type Button}"&gt;
              &lt;Style.Triggers&gt;
                  &lt;DataTrigger Binding="{Binding ButtonEnabled}" Value="True"&gt;
                      &lt;Setter Property="IsEnabled" Value="True"/&gt;
                  &lt;/DataTrigger&gt;
                  &lt;DataTrigger Binding="{Binding ButtonEnabled}" Value="False"&gt;
                      &lt;Setter Property="IsEnabled" Value="False"/&gt;
                  &lt;/DataTrigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
      &lt;/Button.Style&gt;
  &lt;/Button&gt;
  </code></pre>