Repository navigation
ResponsiveSpanningGridWrapLayout: an ItemsRepeater layout with responsive columns and column spans
#827
xperiandri
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
There is no
ItemsRepeaterlayout for dashboard and card pages that needs both of these at once:AdaptiveGridViewdid), andProposal
ResponsiveSpanningGridWrapLayout, aNonVirtualizingLayoutforItemsRepeater:floor((width + ColumnSpacing) / (MinColumnWidth + ColumnSpacing)), and the columns share the full width.Grid.ColumnSpan, as inUniformGrid, so no new attached property is needed. A span that is not smaller than the column count makes a full-width row that is measured to its natural height (group headers). All other items shareItemHeight.MinColumnWidth(200),ColumnSpacing(8),RowSpacing(8) andItemHeight(200).What exists today
UniformGridLayout(WinUI) withItemsStretch="Uniform"is the suggestedAdaptiveGridViewreplacement (Add migration samples forAdaptiveGridView(i.e. samples showing similar layout withItemsRepeater) Windows#131;AdaptiveGridViewwas left out of the port for now, Port Layout Primitives Windows#8). It has responsive columns, but every item has the same size and there are no spans.VariableSizedWrapGrid(WinUI) hasColumnSpanandRowSpan, but its cells have a fixedItemWidthand do not stretch, and it is a panel, not anItemsRepeaterlayout.UniformGrid(Toolkit Primitives) supportsGrid.ColumnSpanand stretches, but the number of columns isColumnsor derived from the number of items (Math.Ceiling(Math.Sqrt(count))), not from the width.StaggeredLayout(Toolkit) has a column grid, but it is a masonry layout without spans.WrapLayout(Toolkit),WrapPanel2and the JustifiedLayout idea ([Feature] JustifiedLayout #435) in Labs, andLinedFlowLayout(WinUI) lay out each row on its own, so there is no shared column grid and no spans.Source and open questions
I found the layout in VincentH-Net/dotnet-agentic-engineering (MIT, Copyright (c) 2026 Vincent Hoogendoorn, about 240 lines, documented here). I am not the author. It is written for Uno Platform, but it uses only WinUI and BCL APIs.
Points to settle before an experiment:
ColumnSpanattached property. ReadingGrid.ColumnSpaninstead keeps the XAML simple and consistent withUniformGrid.Grid.GetColumnSpantakes aFrameworkElement, so any other element would count as span 1.LayoutState.span >= columns, so items switch fromItemHeightto their natural height when the window narrows (aColumnSpan="2"card at two columns, every item at one column). An explicit header marker would be more predictable.Would this be welcome as a Labs experiment? I am happy to prepare it and to credit the author.
All reactions