title: "Cannot convert string to ImageSource." How can I do this?
body: <pre><code>private void HeroMouseEnter(object sender, MouseEventArgs e)
      {
          ((Image)sender).Source = GetGlowingImage(((Image)sender).Name);            
      }
  
      public ImageSource GetGlowingImage(string name)
      {
          switch (name)
          {
              case "Andromeda":
                  return "HeroGlowIcons/64px-Andromeda.gif";                
              default:
                  return null;
          }
      }
  </code></pre>
  
  <p>I'm just trying to make an event to change the image according to where the mouse entered. But I cannot make this work. </p>
  
  <p><strong>Edit: I did this in Windows Forms and it work 100% like I want it to. How could I translate something like this in WPF?</strong></p>
  
  <pre><code>void HeroMouseEnter(object sender, EventArgs e)
      {
          ((PictureBox)sender).Image = GetGlowingImage(((PictureBox)sender).Name);           
      }
  
  
      public Image GetGlowingImage(string name)
      {
          switch (name)
          {
              case "Andromeda":
                  return Properties.Resources._64px_Andromedahero___copia;
              case "Engineer":
                  return Properties.Resources._64px_Engineerhero___copia;
              default:
                  return null;
          }
      }
  </code></pre>