title: Handling null when binding to an Image in XAML
body: <p>I have an Image element in XAML. I bind the Source property to a string property in my ViewModel. However, sometimes the value is null and then I get errors in the debug window.</p>
  
  <p>I read here: <a href="https://stackoverflow.com/questions/5399601/wpf-imagesourceconverter-error-for-source-null">ImageSourceConverter error for Source=null</a> that I could make a converter to return DependencyProperty.UnsetValue if the value is null.</p>
  
  <p>Now I'm wondering if it is possible to do it directly in XAML? Perhaps by using a FallbackValue?
  I have tried some variants but with no luck.</p>
  
  <p>This is my Image element in XAML:</p>
  
  <pre><code>&lt;Image Name="img" Source="{Binding Path=CurrentImageSource}" Stretch="None" /&gt;
  </code></pre>
  
  <p>And CurrentImageSource is just a string property on the DataContext.</p>
  
  <p>The error message is:
  System.Windows.Data Error: 23 : </p>
  
  <blockquote>
    <p>Cannot convert '' from type '' to type
    'System.Windows.Media.ImageSource' for 'sv-SE' culture with default
    conversions; consider using Converter property of Binding.
    NotSupportedException:'System.NotSupportedException:
    ImageSourceConverter cannot convert from (null).</p>
  </blockquote>