title: Silverlight / C# image not found exception handling
body: <p>I am trying to handle the case where an image i am looking for does not exist - it should default to a stock-icon image.</p>
  
  <p>i.e.:
  -- when sampleimage = <a href="http://www.google.com/images/logos/ps_logo2.png" rel="nofollow">http://www.google.com/images/logos/ps_logo2.png</a> (exists - it should return fine)
  -- when sampleimage  = <a href="http://www.thisimagedoesnotexist.com/something.png" rel="nofollow">http://www.thisimagedoesnotexist.com/something.png</a> (does not exist - it should go into the catch block)</p>
  
  <p>Below is my code i am using - however it <em>never goes into the catch block when the image does not exist</em>. I am usin this in a Silverlight application. Any sugestions on how i can get this to work?</p>
  
  <pre><code>try
              {
                  image.Source = new BitmapImage(new Uri(sampleimage, UriKind.Absolute));
              }
              catch (OutOfMemoryException)
              {
                  sampleimage  = "defaulticon.jpg";
                  image.Source = new BitmapImage(new Uri(sampleimage, UriKind.Absolute));
              }  
  </code></pre>