Stretching items
So, this is an idea I came up with earlier and I fully understand if you deem it out-of-scope for this project, but I believe it is at least worth considering.
Basically, instead of each item having a fixed size and spacing being added between them, it would be nice if each item could expand up to a maximum size to fill the remaining space.
A naive algorithm might look something like this:
- How many items can I possibly fit in the current row? -> N
- What is the maximum width for each item? -> W
- Is N*W smaller than my final width F?
- no:
- Set each item's width to F/N
- yes:
- Set each item's width to W and distribute the remaining F-W units as spacing between items
The different spacing options could be configurable with an enum value (<VirtualizingWrapPanel SpacingMode="None|Regular|Flush|Stretch">
) or the stretchy variant could be a separate control.
Illustration, building on my suggestion in #24 (closed):
Edited by Mario Welzig