In a Silverlight 4 project I have a class that extends Canvas:
public class AppendageCanvas : Canvas
{
public float Friction { get; set; }
public float Restitution { get; set; }
public float Density { get; set; }
}
I use this canvas in Blend by dragging it onto another control and setting the custom properties:
alt text http://www.farseergames.com/storage/share/PropertyInBlend.Png
When I run the app, I get the following error when InitializeComponent is called on the control containing my custom canvas:
Failed to create a 'Windows.Foundation.Single' from the text '0.0'
alt text http://www.farseergames.com/storage/share/SilverlightError.Png
I'm not sure why Silverlight isn't able to convert this property from it's string representation in Xaml, to the float that it is.
Anyone have any ideas?
The Native Text Syntaxes sub-topic lists the types that Xaml natively knows how to convert. Fundementally the primitive types supported are double
, int
, bool
and string
.
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