Skip to content
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

Add SpacingProperty to VirtualizingStackPanel #17356

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Neakita
Copy link

@Neakita Neakita commented Oct 26, 2024

What does the pull request do?

This PR adds SpacingProperty from StackPanel to VirtualizingStackPanel and complements MeasureOverride and ArrangeOverride accordingly

What is the current behavior?

At the moment, VirtualizingStackPanel does not have SpacingProperty and instead you have to use Margin on items and negative Margin in their common container to achieve the same result.

What is the updated/expected behavior with this PR?

Port SpacingProperty from StackPanel to VirtualizingStackPanel taking virtualization into account.

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Fixed issues

Fixes #17336

@Neakita Neakita changed the title Add SpacingProperty to VirtualizingStackPanel WIP Add SpacingProperty to VirtualizingStackPanel Oct 26, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0052800-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Oct 26, 2024

  • All contributors have signed the CLA.

@Neakita
Copy link
Author

Neakita commented Oct 29, 2024

@cla-avalonia agree

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0052854-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

…acing and _realizedElements.FirstIndex greater than zero
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0052858-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0052868-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@Neakita Neakita changed the title WIP Add SpacingProperty to VirtualizingStackPanel Add SpacingProperty to VirtualizingStackPanel Oct 30, 2024
@Neakita Neakita marked this pull request as ready for review October 30, 2024 03:48
@Neakita
Copy link
Author

Neakita commented Oct 30, 2024

Seems to be working now:

ControlCatalog.Desktop_KiXoMxkd3k.mp4

although there are some TODO’s that require attention:
https://github.com/Neakita/Avalonia/blob/fd2d0f4bb201c9e9034b5f87d6e7f47bc4a6d9bc/src/Avalonia.Controls/VirtualizingStackPanel.cs#L233
https://github.com/Neakita/Avalonia/blob/fd2d0f4bb201c9e9034b5f87d6e7f47bc4a6d9bc/src/Avalonia.Controls/VirtualizingStackPanel.cs#L719

and also the obvious lack of tests (they are only two and they do not check, actually, virtualization), about which I need some third party opinion.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0052870-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 requested a review from grokys November 5, 2024 03:26
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.

VirtualizingStackPanel Spacing property
3 participants