I've applied a TypeConverterAttribute attribute to a property on my WPF FrameworkElement subclass. The property is of type BitmapSource.
But the TypeConverter is never created or called. Is this because the TypeConverter specified on ImageSource takes precedence?
I'm trying to debug a data binding problem. The error message, never makes mention of my TypeConverter class, suggesting that adding the attribute to the property has had no effect:
System.Windows.Data Error: 6 : 'TargetDefaultValueConverter' converter failed to convert value '../SmallItemIcons/Gallery.png' (type 'String'); fallback value will be used, if available. BindingExpression:Path=SmallImage.ImageUri; DataItem='ItemSettings' (HashCode=32104365); target element is 'Bitmap' (Name=''); target property is 'Source' (type 'BitmapSource') IOException:'System.IO.IOException: Cannot locate resource 'smallitemicons/gallery.png'.
at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
at System.IO.Packaging.PackWebResponse.GetResponseStream()
at System.IO.Packaging.PackWebResponse.get_ContentType()
at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId, Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream& unmanagedMemoryStream, SafeFileHandle& safeFilehandle)
at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)
at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy)
at System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
at MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)
at MS.Internal.Data.TargetDefaultValueConverter.Convert(Object o, Type type, Object parameter, CultureInfo culture)
at System.Windows.Data.BindingExpression.ConvertHelper(IValueConverter converter, Object value, Type targetType, Object parameter, CultureInfo culture)'