-
Notifications
You must be signed in to change notification settings - Fork 100
HeaderedContentControl missing Padding passthru #650
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
Comments
@niels9001 thoughts here on what padding should control, I imagine content? As I think for the one we do pass through today it's set on the items container or what not? |
Hmm, good question.. wouldn't you set a margin on the content itself then? Not sure what e.g. ListView does when a Header is used and a custom padding is set? Or e.g. a TextBox or ComboBox. |
Welp, the platform isn't consistent here...
|
The
The XAML: <Grid
ColumnDefinitions="*,*"
RowDefinitions="*,*,*">
<ListView
Grid.Row="0"
Grid.Column="0"
BorderBrush="SkyBlue"
BorderThickness="1"
Header="No Padding"
ItemsSource="{x:Bind Items}"
SelectedIndex="0" />
<ListView
Grid.Row="0"
Grid.Column="1"
Padding="32"
BorderBrush="SkyBlue"
BorderThickness="1"
Header="Padding"
ItemsSource="{x:Bind Items}"
SelectedIndex="0" />
<ComboBox
Grid.Row="1"
Grid.Column="0"
BorderBrush="SkyBlue"
BorderThickness="1"
Header="No Padding"
ItemsSource="{x:Bind Items}"
SelectedIndex="0" />
<ComboBox
Grid.Row="1"
Grid.Column="1"
Padding="32"
BorderBrush="SkyBlue"
BorderThickness="1"
Header="Padding"
ItemsSource="{x:Bind Items}"
SelectedIndex="0" />
<toolkit:HeaderedContentControl
Grid.Row="2"
Grid.Column="0"
BorderBrush="SkyBlue"
BorderThickness="1"
Header="No Padding">
<TextBlock Text="Content" />
</toolkit:HeaderedContentControl>
<toolkit:HeaderedContentControl
Grid.Row="2"
Grid.Column="1"
Padding="32"
BorderBrush="SkyBlue"
BorderThickness="1"
Header="Padding">
<TextBlock Text="Content" />
</toolkit:HeaderedContentControl>
</Grid> |
@AndrewKeepCoding Thanks for this detailed analysis 😁! @michael-hawker @AndrewKeepCoding Looking at this, it seems to be most natural to set the padding on the entire control (like ListView) does? If I'd need to set a specific padding on the content that I'm displaying I think I'd expect to set the margin on the control (e.g. for adding additional spacing between the content and header? @michael-hawker did you have a specific use case in mind? |
I agree. The |
Yeah, I guess that makes sense from ListView, as the Margin is the outside space before the border, with the padding in the inner space. And if you want padding in the Header, you can define your own element with its own margin or padding. My main case was more around adjusting the padding within the header itself, but that's probably more niche. |
Describe the bug
Setting
Padding
on HeaderedContentControl does nothing.I think this is passed through for HIC, but maybe not for HTV as well?
We should ensure template bound common properties are setup.
Not sure if it should apply just to content and/or header. Whichever one it doesn't control should probably have a resource key.
Steps to reproduce
Expected behavior
padding changes
Screenshots
No response
Code Platform
Windows Build Number
Other Windows Build number
No response
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
No response
Visual Studio Build Number
No response
Device form factor
No response
Additional context
No response
Help us help you
Yes, but only if others can assist.
The text was updated successfully, but these errors were encountered: