David Veeneman
David Veeneman

Reputation: 19122

Exception: 'IValueConverter' type does not have a public TypeConverter class

I have just run into this exception on an IValueConverter I am implementing:

IValueConverter type does not have a public TypeConverter class

Has anyone else come across this? What's the cause, and how do I fix? Thanks.

Upvotes: 12

Views: 7655

Answers (2)

Joel Cochran
Joel Cochran

Reputation: 7738

Here is an article I wrote about the same problem, but with a different cause. In my case, I had referenced the wrong Brush class in the wrong namespace.

Upvotes: 0

David Veeneman
David Veeneman

Reputation: 19122

Simple solution, as it turns out. I had referenced my value converter like this:

<Binding Path="Foreground" Converter="StaticResource BrushToRgbConverter" ConverterParameter="B" />

instead of this:

<Binding Path="Foreground" Converter="{StaticResource BrushToRgbConverter}" ConverterParameter="B" />

In other words, I had omitted the braces from my Converter reference.

Upvotes: 45

Related Questions