title: C# WPF ToggleButton Changing more than one property in a trigger?
body: <p>I have a togglebutton and when it is clicked I simply want to change the background and the content.  The content changes correctly, but the background changes, but instead of my specified background value, it is a default (?) blue-ish.  In previous struggles I could get the background to change, but not the content.  That was done differently, though, w/ a datatrigger instead of the method below.</p>
  
  <p>I'm using C# WPF and MVVM and could bind the content to another property and when the binded ischecked property is changed, I could change the property in the viewmodel, but I was hoping not to have to do that.  Maybe it's the correct way?</p>
  
  <p>Here's my code that 1/2 works:</p>
  
  <pre><code>        &lt;ToggleButton Name="Axis3AbsIncButton"               
              IsChecked="{Binding Path=UserControlOneStatic.MotionParameters.Axis3AbsorIncOption, Source={StaticResource Locator}}"&gt;
                  &lt;ToggleButton.Style&gt;
                      &lt;Style TargetType="{x:Type ToggleButton}"&gt;
                          &lt;Setter Property="ToggleButton.Background" Value="Goldenrod"/&gt;
                          &lt;Setter Property="ToggleButton.Content"
                                  Value="ABS" /&gt;
                          &lt;Style.Triggers&gt;
                              &lt;Trigger Property="IsChecked" Value="True"&gt;
                                  &lt;Setter Property="ToggleButton.Background"
                                          Value="Green" /&gt;
                                  &lt;Setter Property="ToggleButton.Content"
                                          Value="Inc" /&gt;
                              &lt;/Trigger&gt;
                          &lt;/Style.Triggers&gt;
                          &lt;/Style &gt;
                  &lt;/ToggleButton.Style&gt;
              &lt;/ToggleButton&gt;
  </code></pre>
  
  <p><strong>This is very close, but I have lost the border of the togglebutton:</strong></p>
  
  <pre><code>            &lt;ToggleButton Name="Axis3AbsIncButton"
                            Grid.Row="2"
                            Grid.Column="13"
                            Grid.ColumnSpan="2"
                            Grid.RowSpan="1"
                            Focusable="True"
                            IsChecked="{Binding Path=UserControlOneStatic.MotionParameters.Axis3AbsorIncOption, Source={StaticResource Locator}}"&gt;
                  &lt;ToggleButton.Template&gt;
                      &lt;ControlTemplate TargetType="{x:Type ToggleButton}"&gt;
                          &lt;Border CornerRadius="3" BorderThickness="1"  Background="{TemplateBinding Background}"&gt;
                              &lt;ContentPresenter Margin="3"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center" /&gt;
                          &lt;/Border&gt;
                          &lt;ControlTemplate.Triggers&gt;
                              &lt;Trigger Property="IsChecked"
                                       Value="False"&gt;
                                  &lt;Setter Property="Background" 
                                          Value="Goldenrod"&gt;
                                  &lt;/Setter&gt;
                              &lt;/Trigger&gt;                                    
                              &lt;Trigger Property="IsChecked"
                                       Value="True"&gt;
                                  &lt;Setter Property="Background"
                                          Value="Blue" /&gt;
                              &lt;/Trigger&gt;
                          &lt;/ControlTemplate.Triggers&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/ToggleButton.Template&gt;
                  &lt;ToggleButton.Style&gt;
                      &lt;Style TargetType="{x:Type ToggleButton}"&gt;
                          &lt;Setter Property="ToggleButton.Content"
                                  Value="ABS" /&gt;
                          &lt;Style.Triggers&gt;
                              &lt;Trigger Property="IsChecked"
                                       Value="True"&gt;
                                  &lt;Setter Property="ToggleButton.Content"
                                          Value="Inc" /&gt;
                              &lt;/Trigger&gt;
                          &lt;/Style.Triggers&gt;
                      &lt;/Style &gt;
                  &lt;/ToggleButton.Style&gt;
              &lt;/ToggleButton&gt;
  </code></pre>