title: ImageSourceConverter - System.NullReferenceException
body: <p>I'm trying to load an external XML file that contains references to images in WPF.</p>
  
  <pre><code>&lt;page&gt;   
      &lt;foreground path="/data/images/attract/slide1/foreground.png"&gt;
      &lt;background path="/data/images/attract/slide1/background.png"&gt;
  &lt;/page&gt;
  </code></pre>
  
  <p>I'm parsing the XML and using the following code to convert each path attribute to an ImageSource.</p>
  
  <pre><code>string backgroundString = (string)backgroundNode.Attributes["path"].Value;
  Debug.WriteLine(backgroundString); //returns "/data/images/attract/slide1/background.png"
  avm.BackgroundImage = new ImageSourceConverter().ConvertFromString(backgroundString) as ImageSource;
  </code></pre>
  
  <p>The backgroundString I'm parsing is not null when I write it to the debug output. However, I'm getting the following error.</p>
  
  <pre><code>A first chance exception of type 'System.NullReferenceException' occurred in PresentationCore.dll
  System.NullReferenceException: Object reference not set to an instance of an object.
  at System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
  at System.ComponentModel.TypeConverter.ConvertFromString(String text)
  </code></pre>
  
  <p>Does anyone see what I'm doing wrong? Any help would be much appreciated.</p>
  
  <p>Thanks,
  Bryan</p>