wpf - Unexplained error: "Unexpected Token after end of Markup Extensions" -


having converted application wpf silverlight, visual studio indicating strange compiler error in 1 of xaml files:

error 11 unexpected token after end of markup extension.

there no indication line causing error, offending code seems this:

<datatemplate x:key="tooltiptemplate">     <stackpanel orientation="horizontal">         <textblock              text="{binding datapoint.dataitem.date,stringformat={}{0:mm/dd/yyyy}}"              foreground="{staticresource resourcekey=othercolor}" />         <textblock              text="{binding datapoint.dataitem.price,stringformat={}{0:0.00#}}"               foreground="{staticresource resourcekey=othercolor}"/>     </stackpanel> </datatemplate> 

what cause of error?

the problem stringformat value -- wpf can tolerate not being wrapped in single-quotes, apparently silverlight cannot.

changing this:

<textblock text="{binding datapoint.dataitem.price,stringformat={}{0:0.00#}}" /> 

to this:

<textblock text="{binding datapoint.dataitem.price,stringformat='{}{0:0.00#}'}" />                                                                 ^           ^ 

removes error.

put down hazard of converting wpf silverlight.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -