diff --git a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewBaseItem.cs b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewBaseItem.cs index d0d9df7e90b2..6eb448c3457b 100644 --- a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewBaseItem.cs +++ b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewBaseItem.cs @@ -9,6 +9,8 @@ using CCalendarViewBaseItemChrome = Microsoft.UI.Xaml.Controls.CalendarViewBaseItem; using DateTime = Windows.Foundation.WindowsFoundationDateTime; using Uno.UI.Xaml; +using Uno.UI.Extensions; + #if HAS_UNO_WINUI using Microsoft.UI.Input; @@ -293,8 +295,8 @@ internal bool FocusSelfOrChild( if (spItemToFocus is { }) { - var focused = FocusManager.SetFocusedElementWithDirection(spItemToFocus, focusState, false /* animateIfBringIntoView */, false, focusNavigationDirection); - pFocused = !focused; + var focused = this.SetFocusedElementWithDirection(spItemToFocus, focusState, false /* animateIfBringIntoView */, focusNavigationDirection); + pFocused = focused; } return pFocused; diff --git a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial.cs b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial.cs index 64b78d1861cb..8c507181d4e4 100644 --- a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial.cs +++ b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial.cs @@ -19,6 +19,7 @@ using Uno.Extensions; using DayOfWeek = Windows.Globalization.DayOfWeek; using DateTime = Windows.Foundation.WindowsFoundationDateTime; +using Uno.UI.Extensions; namespace Microsoft.UI.Xaml.Controls { @@ -2134,7 +2135,7 @@ private void OnDisplayModeChanged( //A control must be focused before we can set Engagement on it, attempt to set focus first bool focused = false; - focused = FocusManager.SetFocusedElementWithDirection(spScrollViewer, FocusState.Keyboard, false /*animateIfBringintoView*/, false, FocusNavigationDirection.None); + focused = this.SetFocusedElementWithDirection(spScrollViewer, FocusState.Keyboard, false /*animateIfBringintoView*/, FocusNavigationDirection.None); if (focused) { FocusManager.SetEngagedControl(spScrollViewer); diff --git a/src/Uno.UI/UI/Xaml/Input/FocusManager.mux.static.cs b/src/Uno.UI/UI/Xaml/Input/FocusManager.mux.static.cs index 24823c9bf792..713462f5364b 100644 --- a/src/Uno.UI/UI/Xaml/Input/FocusManager.mux.static.cs +++ b/src/Uno.UI/UI/Xaml/Input/FocusManager.mux.static.cs @@ -488,7 +488,8 @@ private bool SetFocusedElement( focusState, animateIfBringIntoView, forceBringIntoView, - focusNavigationDirection); + focusNavigationDirection, + false); return pFocusUpdated; }