-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BoxShadow.ToString() do not allow to parse it again (exception thrown) #14211
Comments
OffsetX and OffsetY are required all the time |
@Gillibald Sure, but in the ToString method, if OffsetX or OffsetY is zero, it is skiped. The two BoxShadow below produce the same output string, and cannot be parsed as they do not have a minimum of 3 values. It is even worse when using other parameters, as we can't know if the 1 is for OffsetX or Y, Blur or Spread: My suggestion is to remove the four zero checks in the ToString() and to always write OffsetX, Y, Blur, Spread in the output string. |
It should look like so:
The other parameters are optional |
Personnally I never use Spread so that's fine to me, but if you keep the checks you cannot differentiate those cases: Blur = 0 and Spread = 1 So I think it is better to always write all four values. |
Describe the bug
The ToString() method of BoxShadow to not allow to Parse it again. It throw an exception.
To Reproduce
Expected behavior
ToString() should write all BoxShadow properties all the time, or we cannot parse it again, and also we don't know what value in the string correspond to what properties...
I would like to do:
var boxShadow2 = BoxShadow.Parse(boxShadow1.ToString())
Environment
Additional context
In the code below, we don't know don't know what value in the string correspond to what property...
The text was updated successfully, but these errors were encountered: