title: Change Images on Custom CheckBox in WPF
body: <p>All I have created the following custom <code>CheckBox</code> which uses images instead of a <code>CheckBox</code>. This works well however, I want to be able to change the images as required. Ideally I would like to use application resources <code>Properties.Resources.SomeImage16</code> (a .png file). The XAML is </p>
  
  <pre><code>&lt;Style x:Key="styleCustomCheckBox" 
         TargetType="{x:Type CheckBox}"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type CheckBox}"&gt;
                  &lt;StackPanel Orientation="Horizontal"&gt;
                      &lt;Image x:Name="imageCheckBox" 
                             Width="16" 
                             Height="16" 
                             Source="F:\Camus\ResourceStudio\Graphics\Images\UnPinned16.png"/&gt;
                      &lt;ContentPresenter VerticalAlignment="Center"/&gt;
                  &lt;/StackPanel&gt;
                  &lt;ControlTemplate.Triggers&gt;
                      &lt;Trigger Property="IsChecked" Value="False"&gt;
                          &lt;Setter TargetName="imageCheckBox" 
                                  Property="Source" 
                                  Value="F:\Camus\ResourceStudio\Graphics\Images\Pinned16.png"/&gt;
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="IsChecked" Value="True"&gt;
                          &lt;Setter TargetName="imageCheckBox" 
                                  Property="Source"
                                  Value="F:\Camus\ResourceStudio\Graphics\Images\UnPinned16.png"/&gt;
                      &lt;/Trigger&gt;
                  &lt;/ControlTemplate.Triggers&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>With implementation </p>
  
  <pre><code>&lt;ListBox SelectionMode="Single" &gt;
      &lt;StackPanel Orientation="Horizontal"&gt;
          &lt;CheckBox Style="{StaticResource styleCustomCheckBox}" 
                    HorizontalAlignment="Left" 
                    VerticalAlignment="Center"
                    Margin="4,0,4,0"/&gt;
          &lt;TextBlock VerticalAlignment="Top" 
                     Text="SomeRecentDocument.resx"/&gt;
      &lt;/StackPanel&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p><strong>How can I change the images used for the custom <code>CheckBox</code> (i.e. change the pinned/un-pinned to tick/cross etc.) without having to create a new style/template?</strong></p>
  
  <p>Thanks for your time.</p>