views:

13

answers:

1

Hi,

I need to define canvas width and height in centimeters, so basically I have such code snippet:

    <Canvas x:Name="Template" Height="10cm" Width="10cm" />

and VS2010 designer do not give me any error and shows my canvas correctly, but when I want to execute my application I received XamlParseException exception:

Failed to create a 'System.Double' from the text '10cm'. [Line: 18 Position: 42]

According to Microsoft (http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.width.aspx) it is possible to use QualifiedDoubles with Width/Height property. Of course, I can make this conversion in code-behind using LegthConverter class from Silverlight Toolkit.

Basically the question is - what am I doing wrong? and is it possible to use qualifiedDouble values in SilverLight XAML?

A: 

From the Silverlight page for the Width property (here), qualified doubles are not supported.

<frameworkElement Width="double"/>
-or-
<frameworkElement Width="Auto"/>
Eric