Add spacing between Header and Content in HeaderedContentControl #532
Labels
feature request 📬
A request for new changes to improve functionality
good first issue
Good for newcomers
Milestone
Describe the bug
I noticed an inconsistency in the
HeaderedContentControl
provided by this package. In a standard Windows 11 app like Settings (or any other default app), there is a9
pixel gap between the header and content of theHeaderedContentControl
. However, in the current implementation, there is no gap at all, except for the default1
pixel from theGrid
.Steps to reproduce
HeaderedContentControl
to the layout.Header
property, for example,Hello, world!
Button
as the content of theHeaderedContentControl
Hello, world!
andButton
is only 1 pixel.Expected behavior
Users can set the gap between the
Header
andContent
, for example, to8
px (so that the total gap is9
px).Solution 1
Forward the
Padding
property to theMargin
of the ContentPresenter namedContentPresenter
:This would allow the user to set a Padding of
"0, 8, 0, 0"
and achieve the original, familiar gap.Solution 2
Add a
Spacing
field (the gap betweenHeader
andContent
):int
.Declare a new
RowDefinition
/ColumnDefinition
with the height/width equal toSpacing
, depending on the orientation.Solution 3
Add a
Spacing
field (the gap betweenHeader
andContent
):Thickness
.In the ContentPresenter named
ContentPresenter
, set thePadding
property toSpacing
.Screenshots
Settings, 9px
Community Toolkit, 1px
Code Platform
Windows Build Number
Other Windows Build number
Windows 11 24H2 (Build 26100)
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
Preview
Visual Studio Build Number
17.11.0 Preview 5.0
Device form factor
Desktop
Additional context
CommunityToolkit.WinUI.Controls.HeaderedControls:
8.1.240821
Help us help you
No, I'm unable to contribute a solution.
The text was updated successfully, but these errors were encountered: