Saturday, January 5, 2013

The TypeConverter for "FontWeight" does not support converting from a string

The TypeConverter for "FontWeight" does not support converting from a string

After installing Visual Studio 2012 and opening a Silverlight 5 project I'm getting various design time errors related to TypeConverter, such as:

The TypeConverter for "FontWeight" does not support converting from a string.

The TypeConverter for "Point" does not support converting from a string.

The TypeConverter for "Thickness" does not support converting from a string.

That's not an exhaustive list, however.

Examples of these being:

<Setter Property="FontWeight" Value="Bold" />

<RadialGradientBrush GradientOrigin="0.5,0.5"> ...

<Setter Property="Padding" Value="0" />

Am I missing something obvious here, or is this a bug?

Answers & Comments...

Answer: 1

I had the same problem: defined in the resources section

<UserControl.Resources>   <local:MyConverter x:Key="myConverter"/> </UserControl.Resources> 

In the XAML UE, I had to change

...Width="{Binding BindingProperty, Converter=myConverter}"... 

to

...Width="{Binding BindingProperty, Converter={StaticResource myConverter}..." 
by : user785529http://stackoverflow.com/users/785529

Answer: 2

Got a simular problem:

The TypeConverter for "Thickness" does not support converting from a string

No Converters used in this XAML file

It's a silverlight project (Prism) who has been converted from SL4 to SL5. But there seems to be more going on, I also get errors like this:

The specified value cannot be assigned to the collection. The following type was expected: "Inline".

When TextBlock is used like this:

<TextBlock>Hello</TextBlock>

To get rid of that error:

<TextBlock Text="Hello" />

Its a bit cumbersome to start the application to see the result of XAML changes

by : Mojito71http://stackoverflow.com/users/252665




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog