title: How to change the background image of a button when clicked?
body: <p>I have a button and set its background image. How can I change its image at run time when it is touched and again it should change to the previous image when touch is removed. I tried the following code, but dint get the required result -</p>
  
  <pre><code>private void button1_click(object sender, RoutedEventArgs e)
  {
      Button source = (Button)sender;
      Image content = source.Content as Image;
      if (null != content)
      {
          content.Source = new BitmapImage(new Uri("image path"));
      }
  }
  </code></pre>
  
  <p>Thanks in advance.</p>