File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Microsoft.Toolkit.Uwp.UI.Controls/AdaptiveGridView Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,13 @@ private void RecalculateLayout(double containerWidth)
5050
5151 _columns = CalculateColumns ( containerWidth , DesiredWidth ) ;
5252
53- // If there's less items than there's columns,
54- // reduce the column count;
53+ // If there's less items than there's columns, reduce the column count;
5554 if ( _listView != null && _listView . Items != null
5655 && _listView . Items . Count > 0 && _listView . Items . Count < _columns )
5756 {
5857 _columns = _listView . Items . Count ;
5958 }
59+
6060 ItemWidth = ( containerWidth / _columns ) - 5 ;
6161 }
6262
@@ -92,7 +92,8 @@ private void ListViewItems_VectorChanged(Windows.Foundation.Collections.IObserva
9292 {
9393 if ( _listView != null && ! double . IsNaN ( _listView . ActualWidth ) )
9494 {
95- // If the items count changes, check if more or less columns needs to be rendered, in case we were hitting a min-limit.
95+ // If the item count changes, check if more or less columns needs to be rendered,
96+ // in case we were having fewer items than columns.
9697 RecalculateLayout ( _listView . ActualWidth ) ;
9798 }
9899 }
You can’t perform that action at this time.
0 commit comments