title: change background toggle button
body: <p>I try to change the background of a toggle button everytime when it is checked or not,using 2 pictures. At runtime, the toggle button is simple and I don't see any image. This is my code:</p>
  
  <p>
  
  <pre><code>&lt;Canvas Height="25" Name="canvas1" Width="186" Background="White"&gt;
      &lt;ToggleButton Name="toggle1" Height="25" Padding="0" Width="27" Canvas.Left="131" Canvas.Top="0" BorderBrush="{x:Null}" Foreground="{x:Null}"&gt;
  
          &lt;ToggleButton.Resources&gt;
              &lt;Style x:Key="OnOffToggleImageStyle" TargetType="ToggleButton"&gt;
              &lt;Style.Triggers&gt;
                  &lt;Trigger Property="IsChecked" Value="True"&gt;
                          &lt;Setter Property="Background"&gt;
                              &lt;Setter.Value&gt;
                                  &lt;ImageBrush ImageSource="/WpfApp;component/Images/image1.png" Stretch="Uniform" TileMode="None" /&gt;
                              &lt;/Setter.Value&gt;
                      &lt;/Setter&gt;
                  &lt;/Trigger&gt;
                  &lt;Trigger Property="IsChecked" Value="False"&gt;
                      &lt;Setter Property="Background"&gt;
                          &lt;Setter.Value&gt;
                                  &lt;ImageBrush ImageSource="/WpfApp;component/Images/image2.png" Stretch="Uniform" TileMode="None" /&gt;
                              &lt;/Setter.Value&gt;
                      &lt;/Setter&gt;
                  &lt;/Trigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>
          
      
  </p>