title: how to make a image button that change the image when mouse over button WPF?
body: <p>I am trying to make an image button that changes the image when the mouse is over the button, i tried few things</p>
  
  <p>this is the last thing I tried but it doesn't work:</p>
  
  <pre><code>&lt;Button Name="fileNameLink" Margin="15,6,30,1" VerticalAlignment="Top"    Click="btnMinimize_Click" MaxWidth="250" Background="Transparent" Cursor="Hand" Visibility="Visible" Height="16"&gt;
                      &lt;Button.Template&gt;
                          &lt;ControlTemplate TargetType="Button"&gt;
                              &lt;StackPanel&gt;
                                  &lt;Image Name="image1"  Source="{StaticResource Minimize1}" Stretch="None" Visibility="Collapsed"/&gt;
                                  &lt;Image Name="image2" Source="{StaticResource Minimize2}" Stretch="None" Visibility="Visible"/&gt;
                                  &lt;StackPanel.Triggers&gt;
                                      &lt;Trigger Property="IsMouseOver" Value="true"&gt;
                                          &lt;Setter TargetName="image1" Property="Visibility" Value="Visible"/&gt;
                                          &lt;Setter TargetName="image2" Property="Visibility" Value="Collapsed"/&gt;
                                          &lt;/Trigger&gt;
                                  &lt;/StackPanel.Triggers&gt;
                              &lt;/StackPanel&gt;
                          &lt;/ControlTemplate&gt;
                      &lt;/Button.Template&gt;
                      &lt;Button.Style&gt;
                          &lt;Style TargetType="Button"&gt;
                              &lt;Style.Triggers&gt;
                              &lt;/Style.Triggers&gt;
                          &lt;/Style&gt;
                      &lt;/Button.Style&gt;
                  &lt;/Button&gt;
  </code></pre>
  
  <p>i am tring to use the XAML only, without the cs file
  Thanks</p>