Skip to content

Update thickness remark - #2569

Merged
Thraka merged 1 commit into
dotnet:masterfrom
JeroenOortwijn:patch-1
Jul 30, 2019
Merged

Thraka merged 1 commit into
dotnet:masterfrom
JeroenOortwijn:patch-1

Conversation

@JeroenOortwijn

Copy link
Copy Markdown
Contributor

You can specify the Thickness values in three ways, not two.
Also added description of the two-value case. The wording can probably improved however...

You can specify the Thickness values in three ways, not two.
Also added description of the two-value case. The wording can probably improved however...
@mairaw
mairaw requested review from OliaG and merriemcgaw and removed request for OliaG and merriemcgaw June 7, 2019 17:17
@mairaw

mairaw commented Jun 7, 2019

Copy link
Copy Markdown
Contributor

@grubioe who can review this WPF API docs change?

@mairaw mairaw added this to the June 2019 milestone Jun 7, 2019
@merriemcgaw

Copy link
Copy Markdown
Contributor

@vatsan-madhavan can review for WPF most likely

@grubioe

grubioe commented Jun 7, 2019

Copy link
Copy Markdown

yes @vatsan-madhavan or @rladuca can review.

@Thraka

Thraka commented Jul 26, 2019

Copy link
Copy Markdown
Contributor

Pinging @vatsan-madhavan in email

@vatsan-madhavan

Copy link
Copy Markdown
Member

This seems to apply to Windows.UI.Xaml.Thicknes, and not System.Windows.Thickness

@Thraka

Thraka commented Jul 27, 2019

Copy link
Copy Markdown
Contributor

@vatsan-madhavan Are you saying you can only comment on System.Windows.Thickness?

Reading it again, this is good improvement. As far as I can remember, you have always been able to use the three ways of specifying thickness value, value,value, and value,value,value,value.

@vatsan-madhavan

Copy link
Copy Markdown
Member

Reading it again, this is good improvement. As far as I can remember, you have always been able to use the three ways of specifying thickness value, value,value, and value,value,value,value.

My mistake. I looked up the constructors but failed to look carefully at ThicknessConverter.

UWP offers a matching constructor for Thickness(LeftAndRight, TopAndBottom), but WPF doesn't seem to. That said, WPF's ThicnessConverter can definitely convert the three formats outlined in this PR - 2 with matching constructors and 1 without.

The "LeftAndRight, TopAndBottom" string format support looks like an implementation detail in ThicknessConverter - I don't see any documentation in that type or anywhere else that this string format is guaranteed to work. That said, I can't imagine we will break this.

I'll feel better if we were to add a matching public constructor for Thickness, and documented the supported formats in ThicknessConverter also.

This PR looks good to me as-is, but I would request a couple of non-blocking follow-ups.

  • Please update the documentation for ThicknessConverter also with similar language.
  • Open an issue against dotnet/wpf to add a public constructor public System.Windows.Thickness(double LeftAndRight, double TopAndBottom).
    • It's too late to add this for .NET Core 3.0, but we should consider doing this in .NET 5.

@Thraka

Thraka commented Jul 29, 2019

Copy link
Copy Markdown
Contributor

@JeroenOortwijn Thank you for this contribution

@Thraka Thraka closed this Jul 29, 2019
@Thraka Thraka reopened this Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants