From ddb505a2f3634951921153f814ae644f6831a687 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 26 May 2021 09:30:51 -0400 Subject: [PATCH] fix(calendar): Fix possibly failing assert --- .../Primitives/CalendarPanel.ModernCollectionBasePanel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/Primitives/CalendarPanel.ModernCollectionBasePanel.cs b/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/Primitives/CalendarPanel.ModernCollectionBasePanel.cs index 75d561540b8e..a0fdb5aa2d2d 100644 --- a/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/Primitives/CalendarPanel.ModernCollectionBasePanel.cs +++ b/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/Primitives/CalendarPanel.ModernCollectionBasePanel.cs @@ -530,7 +530,7 @@ private Size base_MeasureOverride(Size availableSize) var itemSize = _layoutStrategy.GetElementMeasureSize(ElementType.ItemContainer, index, renderWindow); // Note: It's actually the same for all items var itemBounds = _layoutStrategy.GetElementBounds(ElementType.ItemContainer, index + StartIndex, itemSize, layout, renderWindow); - if (itemSize.Width < _minCellSize.Width && itemSize.Height < _minCellSize.Height) + if (itemSize.Width < _minCellSize.Width && itemSize.Height < _minCellSize.Height || Cols == 0 || Rows == 0) { // We don't have any valid cell size yet (This measure pass has been caused by DetermineTheBiggestItemSize), // so we stop right after having inserted the first child in the Children collection.