diff --git a/src/Uno.UI/UI/Xaml/Controls/CalendarView/Primitives/CalendarPanel.ModernCollectionBasePanel.cs b/src/Uno.UI/UI/Xaml/Controls/CalendarView/Primitives/CalendarPanel.ModernCollectionBasePanel.cs index 24cac68a9dfc..0261fc4e6068 100644 --- a/src/Uno.UI/UI/Xaml/Controls/CalendarView/Primitives/CalendarPanel.ModernCollectionBasePanel.cs +++ b/src/Uno.UI/UI/Xaml/Controls/CalendarView/Primitives/CalendarPanel.ModernCollectionBasePanel.cs @@ -517,11 +517,11 @@ private Rect GetLayoutViewport(Size availableSize = default) var viewport = new Rect( _effectiveViewport.Location.FiniteOrDefault(default), _effectiveViewport.Size.AtLeast(availableSize).AtLeast(_defaultHardCodedSize).FiniteOrDefault(_defaultHardCodedSize)); - if (calendar.HorizontalAlignment != HorizontalAlignment.Stretch) + if (calendar.HorizontalAlignment != HorizontalAlignment.Stretch && double.IsNaN(calendar.Width) && calendar.MinWidth <= 0) { viewport.Width = _defaultHardCodedSize.Width; } - if (calendar.VerticalAlignment != VerticalAlignment.Stretch) + if (calendar.VerticalAlignment != VerticalAlignment.Stretch && double.IsNaN(calendar.Height) && calendar.MinHeight <= 0) { viewport.Height = _defaultHardCodedSize.Height; }