ImageSourceConverter error for Source=null

I'm binding the Source property of an Image to a string. This string may be null in which case I just don't want to display an Image. However, I'm getting the following in my Debug output:

System.Windows.Data Error: 23 : Cannot преобразовать '' из типа '' в тип 'System.Windows.Media.ImageSource' для культура en-AU по умолчанию конверсии; рассмотрите возможность использования конвертера свойство привязки. NotSupportedException: 'System.NotSupportedException: ImageSourceConverter не может преобразовать от (ноль). в System.ComponentModel.TypeConverter.GetConvertFromException (Объект значение) на System.Windows.Media.ImageSourceConverter.ConvertFrom (ITypeDescriptorContext контекст, культура CultureInfo, объект значение) на MS.Internal.Data.DefaultValueConverter.ConvertHelper (Объект o, Введите тип назначения, DependencyObject targetElement, CultureInfo, культура, логическое значение isForward)'

I'd prefer if this wasn't displayed as it's just noise - is there any way to suppress it?

47
задан abatishchev 10 May 2012 в 15:08
поделиться