File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Microsoft.Toolkit.Uwp.UI.Controls.Primitives/WrapPanel Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,13 @@ protected override Size ArrangeOverride(Size finalSize)
166
166
foreach ( var rect in row . ChildrenRects )
167
167
{
168
168
var child = Children [ childIndex ++ ] ;
169
+ while ( child . Visibility == Visibility . Collapsed )
170
+ {
171
+ // Collapsed children are not added into the rows,
172
+ // we skip them.
173
+ child = Children [ childIndex ++ ] ;
174
+ }
175
+
169
176
var arrangeRect = new UvRect
170
177
{
171
178
Position = rect . Position ,
@@ -202,12 +209,12 @@ private Size UpdateRows(Size availableSize)
202
209
var finalMeasure = new UvMeasure ( Orientation , width : 0.0 , height : 0.0 ) ;
203
210
void Arrange ( UIElement child , bool isLast = false )
204
211
{
205
- var desiredMeasure = new UvMeasure ( Orientation , child . DesiredSize ) ;
206
- if ( desiredMeasure . U == 0 )
212
+ if ( child . Visibility == Visibility . Collapsed )
207
213
{
208
214
return ; // if an item is collapsed, avoid adding the spacing
209
215
}
210
216
217
+ var desiredMeasure = new UvMeasure ( Orientation , child . DesiredSize ) ;
211
218
if ( ( desiredMeasure . U + position . U + paddingEnd . U ) > parentMeasure . U )
212
219
{
213
220
// next row!
You can’t perform that action at this time.
0 commit comments