title: toggle button with different images
body: <p>Below given code is used for toggling images. It works but when I click on button white rectangle is shown as a foreground of button. Is there any better way?</p>
  
  <pre><code>private void music_click(object sender, RoutedEventArgs e)
  {
      System.Diagnostics.Debug.WriteLine("music clickedddd");
      switch (key)
      {
          case 1:
              var brush = new ImageBrush();
              BitmapImage image = new BitmapImage(new Uri(@"Images/music pause button.png", UriKind.Relative));
              brush.ImageSource = image;
              music.Background = brush;
  
              key = 0;
              System.Diagnostics.Debug.WriteLine("music clickedddd pause");
              break;
  
          case 0:
              var brush2 = new ImageBrush();
              BitmapImage image2 = new BitmapImage(new Uri(@"Images/Music on.png", UriKind.Relative));
              brush2.ImageSource = image1;
              music.Background = brush2;
  
              key = 1;
              System.Diagnostics.Debug.WriteLine("music clickedddd play");
              break;
      }
  }
  </code></pre>