title: WPF TriState Image Button
body: <p>Does anyone have any pointers for creating a tristate image button? </p>
  
  <p>I have the following but what I really want to do is have a control with multiple ImageSource properties like <code>&lt;Controls.TristateButton Image="" HoverImage="" PressedImage="" /&gt;</code></p>
  
  <pre><code>&lt;Style TargetType="{x:Type Button}"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                  &lt;StackPanel Orientation="Horizontal" &gt;
                      &lt;Image Name="PART_Image" Source="path to normal image" /&gt;
                  &lt;/StackPanel&gt;
                  &lt;ControlTemplate.Triggers&gt;
                      &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                          &lt;Setter Property="Source" Value="path to mouse over image" TargetName="PART_Image"/&gt;
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="IsPressed" Value="True"&gt;
                          &lt;Setter Property="Source" Value="path to pressed image" TargetName="PART_Image"/&gt;
                      &lt;/Trigger&gt;
                  &lt;/ControlTemplate.Triggers&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>