diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CalendarView/CalendarView_Features.xaml b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CalendarView/CalendarView_Features.xaml index 13af7f287bf6..f9eb80c81468 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CalendarView/CalendarView_Features.xaml +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CalendarView/CalendarView_Features.xaml @@ -44,7 +44,7 @@ - + diff --git a/src/Uno.UI.RuntimeTests/IntegrationTests/common/CalendarHelper.h.cs b/src/Uno.UI.RuntimeTests/IntegrationTests/common/CalendarHelper.h.cs index 80b0063c8451..f8c20b3aa1eb 100644 --- a/src/Uno.UI.RuntimeTests/IntegrationTests/common/CalendarHelper.h.cs +++ b/src/Uno.UI.RuntimeTests/IntegrationTests/common/CalendarHelper.h.cs @@ -375,7 +375,11 @@ internal static void VerifyDateTimesAreEqual(DateTimeOffset date1, DateTimeOffse internal static void CheckFocusedItem() { +#if WINDOWS_UWP + var item = FocusManager.GetFocusedElement(); +#else var item = FocusManager.GetFocusedElement(TestServices.WindowHelper.WindowContent.XamlRoot); +#endif TestServices.LOG_OUTPUT("Type of focused item is: %s", item.GetType().FullName); var itemAsFE = (FrameworkElement)(item); if (itemAsFE is { }) diff --git a/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/BaseDxamlTestClass.cs b/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/BaseDxamlTestClass.cs index 82b11b0d812b..4b2411fbae9f 100644 --- a/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/BaseDxamlTestClass.cs +++ b/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/BaseDxamlTestClass.cs @@ -80,12 +80,4 @@ protected static int ARRAYSIZE(Array array) protected static CalendarPanel CalendarPanel(object o) => o as CalendarPanel; protected static CalendarViewDayItem CalendarViewDayItem(object o) => o as CalendarViewDayItem; } - - internal class XcbPurpleBrush : SolidColorBrush - { - internal XcbPurpleBrush() - { - Color = Colors.Purple; - } - } } diff --git a/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendardatepicker/CalendarDatePickerIntegrationTests.cs b/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendardatepicker/CalendarDatePickerIntegrationTests.cs index 696ef92c5114..29dbd055995f 100644 --- a/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendardatepicker/CalendarDatePickerIntegrationTests.cs +++ b/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendardatepicker/CalendarDatePickerIntegrationTests.cs @@ -688,6 +688,7 @@ await RunOnUIThread(() => TestServices.Utilities.VerifyMockDCompOutput(MockDComp.SurfaceComparison.NoComparison); } +#if !WINDOWS_UWP [TestMethod] public async Task DonotResizeCalendarView() { @@ -731,6 +732,7 @@ await RunOnUIThread(() => }); await TestServices.WindowHelper.WaitForIdle(); } +#endif [TestMethod] public async Task CanPresetDate() diff --git a/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendarview/CalendarViewIntegrationTests.cs b/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendarview/CalendarViewIntegrationTests.cs index b496faf1c0f1..df7734cc0ace 100644 --- a/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendarview/CalendarViewIntegrationTests.cs +++ b/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendarview/CalendarViewIntegrationTests.cs @@ -2980,8 +2980,8 @@ await RunOnUIThread(() => cv.MaxDate = ConvertToDateTime(1, 2014, 1, 1); cv.SelectedDates.Add(ConvertToDateTime(1, 2014, 1, 1)); - cv.CalendarItemBorderBrush = new XcbPurpleBrush(); - cv.CalendarItemBackground = new XcbPurpleBrush(); + cv.CalendarItemBorderBrush = new SolidColorBrush { Color = Colors.Purple }; + cv.CalendarItemBackground = new SolidColorBrush { Color = Colors.Purple }; rootPanel.Children.Add(cv); }); diff --git a/src/Uno.UI.RuntimeTests/MUX/Helpers/FlyoutHelper.cs b/src/Uno.UI.RuntimeTests/MUX/Helpers/FlyoutHelper.cs index 3bade8703f88..3a83fc87a71a 100644 --- a/src/Uno.UI.RuntimeTests/MUX/Helpers/FlyoutHelper.cs +++ b/src/Uno.UI.RuntimeTests/MUX/Helpers/FlyoutHelper.cs @@ -26,13 +26,21 @@ public static FrameworkElement GetOpenFlyoutPresenter() public static void HideFlyout(T flyoutControl) where T : FlyoutBase { +#if WINDOWS_UWP + flyoutControl.Hide(); +#else flyoutControl.Close(); +#endif } internal static void OpenFlyout(T flyoutControl, FrameworkElement target, FlyoutOpenMethod openMethod) where T: FlyoutBase { +#if WINDOWS_UWP + flyoutControl.ShowAt(target); +#else flyoutControl.Open(); +#endif } public static void ValidateOpenFlyoutOverlayBrush(string name) diff --git a/src/Uno.UI.RuntimeTests/MUX/Utilities/TestHelpers.cs b/src/Uno.UI.RuntimeTests/MUX/Utilities/TestHelpers.cs index 5789dc57a6ce..d2c4b46ea435 100644 --- a/src/Uno.UI.RuntimeTests/MUX/Utilities/TestHelpers.cs +++ b/src/Uno.UI.RuntimeTests/MUX/Utilities/TestHelpers.cs @@ -104,7 +104,7 @@ public class App public static UIElement TestContentRoot { get => TestServices.WindowHelper.WindowContent; - set => TestServices.WindowHelper.WindowContent = value; + set => TestServices.WindowHelper.WindowContent = value as UIElement; } public static Application Current => Application.Current; diff --git a/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorHost.cs b/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorHost.cs index f1814f5e7764..4b178e103514 100644 --- a/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorHost.cs +++ b/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorHost.cs @@ -353,8 +353,6 @@ internal int CalculateOffsetFromMinDate(DateTime date) long diffInUTC = 0; int diffInUnit = 0; - int maxEstimationRetryCount = 3; // the max times that we should estimate - int maxReboundCount = 3; // the max times that we should reduce the step when the estimation is over the boundary. int minDistanceToEstimate = 3; // the min estimated distance that we should do estimation. pCalendar.SetDateTime(estimatedDate); @@ -363,6 +361,8 @@ internal int CalculateOffsetFromMinDate(DateTime date) // we could need more times (uncommon scenario) var averageTicksPerUnit = GetAverageTicksPerUnit(); #if DEBUG + int maxEstimationRetryCount = 3; // the max times that we should estimate + int maxReboundCount = 3; // the max times that we should reduce the step when the estimation is over the boundary. int estimationCount = 0; #endif while (true) diff --git a/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/calendardatepicker_partial.cs b/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/calendardatepicker_partial.cs index b99a632dd4a5..2a4155183803 100644 --- a/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/calendardatepicker_partial.cs +++ b/src/Uno.UI/Microsoft/UI/Xaml/Controls/CalendarView/calendardatepicker_partial.cs @@ -1065,7 +1065,7 @@ private void SyncDate() date = (DateTime)spDateReference; // if Date property is being set, we should always display the Date when Calendar is open. SetDisplayDate(date); - spSelectedDates.Append(date); + spSelectedDates.Add(date); } } finally diff --git a/src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.net.cs b/src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.net.cs new file mode 100644 index 000000000000..9d5bb7694f9c --- /dev/null +++ b/src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.net.cs @@ -0,0 +1,22 @@ +using System; +using System.Linq; +using Windows.UI.Xaml.Media; +using Uno.Disposables; +using Uno.Extensions; +using Uno.UI.Xaml; + +namespace Windows.UI.Xaml.Shapes +{ + internal class BorderLayerRenderer + { + public void UpdateLayer( + UIElement element, + Brush background, + Thickness borderThickness, + Brush borderBrush, + CornerRadius cornerRadius, + object image) + { + } + } +} 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 f61fc1d8d82e..ee0a4a04e0ee 100644 --- a/src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.wasm.cs +++ b/src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.wasm.cs @@ -160,7 +160,7 @@ public static void SetBackgroundBrush(FrameworkElement element, Brush brush) break; case XamlCompositionBrushBase unsupportedCompositionBrush: var fallbackColor = unsupportedCompositionBrush.FallbackColorWithOpacity; - WindowManagerInterop.SetElementBackgroundColor(HtmlId, fallbackColor); + WindowManagerInterop.SetElementBackgroundColor(element.HtmlId, fallbackColor); RecalculateBrushOnSizeChanged(element, false); break; default: diff --git a/src/Uno.UI/UI/Xaml/FrameworkElement.net.cs b/src/Uno.UI/UI/Xaml/FrameworkElement.net.cs index fdcf0bc2b800..746b9090b7f1 100644 --- a/src/Uno.UI/UI/Xaml/FrameworkElement.net.cs +++ b/src/Uno.UI/UI/Xaml/FrameworkElement.net.cs @@ -17,6 +17,10 @@ public partial class FrameworkElement : IEnumerable internal UIElement VisualParent => ((IDependencyObjectStoreProvider)this).Store.Parent as UIElement; + internal bool ShouldInterceptInvalidate { get; set; } + + internal void UpdateHitTest() { } + private protected virtual void OnPostLoading() { } partial void OnLoadingPartial();