-
-
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
VirtualizingStackPanel Spacing property #17336
Comments
You can implement spacing using nth-child selector |
Are you suggesting to set default item's margin to something like 0 6 0 0 and set the first item's margin to zero with :nth-child(1) selector? |
Another option, which I often use, is adding Marging to all elements, and adding negative margin on the common container. |
Exactly what i did for now, see |
@Neakita maybe you want to file a PR? |
I do not exclude this possibility. I'll probably try to do this over the next few days if I don't have any difficulties cloning the repository, testing changes, or anything else. |
Is your feature request related to a problem? Please describe.
When using ListBox with ItemPanel = StackPanel it's possible to use StackPanel's Spacing property for, well, adding spacing between items:
which is simple and straightforward.
But when i need virtualization i have to use VirtualizingStackPanel for ListBox's ItemPanel which doesn't have the Spacing property.
Describe the solution you'd like
Register or AddOwner of StackPanel.SpacingProperty in VirtualizingStackPanel so it's possible to set Spacing between items in VirtualizingStackPanel in the same way as it is with StackPanel:
which will require changes in Measure/Arrange code.
Describe alternatives you've considered
Simulate Spacing with ListBoxItem margin and compensation of it's margin at the start and end of the ListBox with same but negative margin:
which is an ugly crutch and will require additional markup for both Horizontal-Vertical layouts support.
Additional context
No response
The text was updated successfully, but these errors were encountered: