title: WPF change button image from code behind
body: <p>I would like to check which image is applied to the button and change it in code behind.</p>
  
  <pre><code> &lt;Button x:Name="btnFlashAlert" Content="Button" Canvas.Left="87" Canvas.Top="258" Background="{x:Null}" Margin="136,244,409,215" BorderBrush="{x:Null}" BorderThickness="0" Cursor="Hand" Click="btnFlashAlert_Click"&gt;
          &lt;Button.Template&gt;
              &lt;ControlTemplate&gt;
                  &lt;Image Source="Main/Images/FlashButton.png" Name="image"/&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Button.Template&gt;
      &lt;/Button&gt;
  </code></pre>
  
  <p>My goal is to make the button flash with different color button images not colors when certain values are met to inform the user they have certain types of messages waiting</p>