Beware the decimal separator
The clash between decimal separators, double values and application culture already made Point type a victim. Today I found abound another one..
I had an iframe positioned above my silverlight control. Its dimensions was controlled from C# managed code (with the use of System.Windows.Browser library).
Or at least it should have been.
ERROR:
No matter I gave the right double values to set the iframe’s width, it just didn’t changed:
Iframe.SetStyleAttribute("width", value.ToString() + "px");
SOLUTION:
After a few rounds of debugging I found the solution. The problem was caused by the decimal separator being a comma instead of a point.
The fix is the same as with the Point type:
Iframe.SetStyleAttribute("width", value.ToString(System.Globalization.CultureInfo.InvariantCulture) + “px”);