System.Windows.Rect.ToString() is documented as returning a string in “the following form: “X,Y,Width,Height””.
It seems like this method is the complement to the Parse method, which accepts the “string representation of the rectangle, in the form “x, y, width, height””.
Unfortunately, while Parse
is culture-invariant (as documented), ToString
follows the .NET convention
of returning locale-sensitive results; you need to call the ToString(IFormatProvider)
overload
to produce a string in the “x,y,width,height” format (that can be accepted by Parse
).
I filed a bug report, even though this is arguably an error in the documentation, not in the .NET Framework itself.
Posted by Bradley Grainger on January 02, 2012