From d45ee3eb78f2b8d1c9bbe9913f5a27c164cf6d62 Mon Sep 17 00:00:00 2001 From: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com> Date: Wed, 8 Jan 2025 05:13:56 +0530 Subject: [PATCH] [Windows] Fixed the exception when using CarouselView PeekAreaInsets Property in OnSizeAllocated method (#26865) * Fixed-26822 : Layout could not complete exception arise when using CarouselView PeekAreaInsets Property in OnSizeAllocated method * updated CarouselViewHandler.Windows.cs * Enabled testcases. --- .../src/Core/Handlers/Items/CarouselViewHandler.Windows.cs | 3 +-- .../Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs b/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs index 4d79bddb25a9..9f0763884352 100644 --- a/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs +++ b/src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs @@ -588,9 +588,8 @@ void InvalidateItemSize() { item.ItemHeight = itemHeight; item.ItemWidth = itemWidth; - - item.InvalidateMeasure(); } + ListViewBase.InvalidateMeasure(); } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs index 8f5ba7f1856e..1bc1dc776276 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs @@ -1,5 +1,4 @@ -#if TEST_FAILS_ON_WINDOWS // This test fails on Windows due to app crash, Issue: https://github.com/dotnet/maui/issues/26822 -using NUnit.Framework; +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -21,5 +20,4 @@ public void ChangePeekAreaInsetsInOnSizeAllocatedTest() App.WaitForElement("CarouselId"); } } -} -#endif \ No newline at end of file +} \ No newline at end of file