开发者

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

开发者 https://www.devze.com 2022-12-17 06:51 出处:网络
I have just run into this exception on an IValueConverter I am implementing: IValueConverter type does not have a

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开发者_JAVA技巧 this? What's the cause, and how do I fix? Thanks.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号