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?
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}..."
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
I had the same problem and it was driving me mad! For me it had to do with the Silverlight Toolkit, once I added that I started getting tons of these errors.
In my project file (right-click->Edit project file) I had referenced the toolkit dll like this (relative to source dir in my case):
<Reference Include="System.Windows.Controls.Toolkit">
<HintPath>..\..\..\Bin\System.Windows.Controls.Toolkit.dll</HintPath>
</Reference>
Changing it to this seemed to sort it (I'm not sure if internals is needed too but a new project with SL5 and toolkit added seemed to ref it):
<Reference Include="system.windows.controls.toolkit, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Windows.Controls.Toolkit.Internals, Version=4.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
Hope that helps, John
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With