title: Change a button's content in a style?
body: <p>I'm trying to do something similar to this:</p>
  
  <pre><code>&lt;Window x:Class="WpfApplication1.Window1"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
  
      &lt;Grid&gt;
          &lt;Button&gt;
              &lt;Button.Style&gt;
                  &lt;Style TargetType="{x:Type Button}"&gt;
                      &lt;Setter Property="Content"
                              Value="No mouse over" /&gt;
                      &lt;Style.Triggers&gt;
                          &lt;Trigger Property="IsMouseOver"
                                   Value="True"&gt;
                              &lt;Setter Property="Content"&gt;
                                  &lt;Setter.Value&gt;
                                      &lt;CheckBox Content="Mouse is over" /&gt;
                                  &lt;/Setter.Value&gt;
                              &lt;/Setter&gt;
                          &lt;/Trigger&gt;
                      &lt;/Style.Triggers&gt;
                  &lt;/Style&gt;
              &lt;/Button.Style&gt;
          &lt;/Button&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>However, I get a run-time XamlParseException with a message of: </p>
  
  <blockquote>
    <p>Cannot add content of type
    'System.Windows.Controls.CheckBox' to
    an object of type 'System.Object'. 
    Error at object
    'System.Windows.Controls.CheckBox</p>
  </blockquote>
  
  <p>I'm actually trying to draw different icons for the button's content depending on external conditions. So I'm actually trying to use a DataTrigger, but the example above simplifies the problem. Any ideas?</p>