diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_CalendarView.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_CalendarView.cs index 5ac79ec3fed5..dce7f8d8b009 100644 --- a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_CalendarView.cs +++ b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_CalendarView.cs @@ -1,15 +1,15 @@ using System; -using System.Collections.Generic; -using System.Text; +using System.Reflection; using System.Threading.Tasks; -using Private.Infrastructure; using Microsoft.UI.Xaml.Controls; -using MUXControlsTestApp.Utilities; +using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Media; -using Uno.UI.RuntimeTests.MUX.Helpers; -using Windows.UI; using Microsoft.UI.Xaml.Input; -using System.Reflection; +using MUXControlsTestApp.Utilities; +using Private.Infrastructure; +using Uno.UI.Extensions; +using Uno.UI.RuntimeTests.Helpers; +using System.Linq; #if !HAS_UNO_WINUI using Microsoft/* UWP don't rename */.UI.Xaml.Controls; @@ -22,6 +22,34 @@ namespace Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls; [RunsOnUIThread] public class Given_CalendarView { +#if __WASM__ + [TestMethod] + public async Task When_ItemCornerRadius() + { + var calendarView = new CalendarView(); + calendarView.OutOfScopeBackground = new SolidColorBrush(Microsoft.UI.Colors.Red); + calendarView.CalendarItemCornerRadius = new CornerRadius(40); + calendarView.DayItemCornerRadius = new CornerRadius(20); + + await UITestHelper.Load(calendarView); + await TestServices.WindowHelper.WaitForIdle(); + + var hasOutOfScope = false; + + foreach (var dayItem in calendarView.EnumerateDescendants().OfType()) + { + var color = Uno.Foundation.WebAssemblyRuntime.InvokeJS($"document.getElementById({dayItem.HtmlId}).style[\"background-color\"]"); + if (color == "rgb(255, 0, 0)") + { + hasOutOfScope = true; + var result = Uno.Foundation.WebAssemblyRuntime.InvokeJS($"document.getElementById({dayItem.HtmlId}).style[\"border-radius\"]"); + Assert.AreEqual("21px", result); + } + } + + Assert.IsTrue(hasOutOfScope); + } +#endif #if __ANDROID__ || __IOS__ || __MACOS__ [Ignore("Test fails on these platforms")] #endif diff --git a/src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.wasm.cs b/src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.wasm.cs index 7fc50bd7bd06..6ef1a7448e1e 100644 --- a/src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.wasm.cs +++ b/src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.wasm.cs @@ -11,13 +11,14 @@ using Uno; using Uno.UI.Helpers; using Uno.UI.Extensions; +using Windows.Foundation; namespace Microsoft.UI.Xaml.Shapes { partial class BorderLayerRenderer { private Brush _background; - private (Brush, Thickness, CornerRadius) _border; + private (Brush, Thickness, CornerRadius, Size) _border; private Action _backgroundChanged; @@ -38,9 +39,10 @@ public void UpdateLayer( SetAndObserveBackgroundBrush(fwElt, oldValue, background, ref _backgroundChanged); } - if (_border != (borderBrush, borderThickness, cornerRadius)) + var renderSize = element.RenderSize; + if (_border != (borderBrush, borderThickness, cornerRadius, renderSize)) { - _border = (borderBrush, borderThickness, cornerRadius); + _border = (borderBrush, borderThickness, cornerRadius, renderSize); SetBorder(element, borderThickness, borderBrush, cornerRadius); } } diff --git a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewDayItem.Properties.cs b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewDayItem.Properties.cs index 5d4315335acf..02a921647137 100644 --- a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewDayItem.Properties.cs +++ b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewDayItem.Properties.cs @@ -28,6 +28,9 @@ public bool IsBlackout } internal set { +#if DEBUG + put_Date(value); +#endif this.SetValue(DateProperty, value); } } diff --git a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewDayItem.cs b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewDayItem.cs index dc4f28eba123..88168aa78653 100644 --- a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewDayItem.cs +++ b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewDayItem.cs @@ -140,11 +140,11 @@ protected override void OnKeyDown( } -#if DEBUG && false +#if DEBUG private void put_Date(DateTime value) { SetDateForDebug(value); - CalendarViewDayItemGenerated.Date = value; + //CalendarViewDayItemGenerated.Date = value; } #endif