title: Showing Bitmap Images in WPF via C#
body: <p>What I am trying to do is so simple but I am having a hard time making it work. I saw some posts along the same lines but I still have questions.</p>
  
  <p>I have a MenuItem object called mnuA. All I want is set the icon property programatically in C#. I have tried the following</p>
  
  <p>a) <code>mnuA.Icon = new BitmapImage{UriSource = new Uri(@"c:\icons\A.png")};</code>
  Results: Instead of showing the actual icon, I get the class name (<code>System.Windows.Media.Imaging.BitmapImage</code>)</p>
  
  <p>b) <code>mnuA.Icon = new BitmapImage(new Uri(@"c:\icons\A.png"));</code>
  Results: Instead of showing the actual icon, I get the path of the image (<code>file:///c:/icons/A.png</code>)</p>
  
  <p>What am I doing wrong? Do I really need a converter class for something simple like this?</p>