Skip to content

Commit b7a2566

Browse files
committed
fix: Adjust error messages for WinUI mode
1 parent 7808480 commit b7a2566

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Uno.UI/UI/Xaml/Input/FocusManager.mux.static.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ private static bool TryMoveFocusStatic(
248248
// Return error if call is without focus navigation option in islands/ desktop
249249
if (pCore.GetHandle().InitializationType == InitializationType.IslandsOnly)
250250
{
251-
throw new InvalidOperationException("Focus navigation options must be set for desktop apps.");
251+
throw new InvalidOperationException("Focus navigation options must be set, provide a SearchRoot in FindNextElementOptions.");
252252
}
253253

254254
// For compat reasons, these FocusManager static APIs need to always use the CoreWindow as the
@@ -380,7 +380,7 @@ private static IAsyncOperation<FocusMovementResult> TryFocusAsyncImpl(
380380
if (InIslandsMode())
381381
{
382382
// This api is not supported in islands/ desktop mode.
383-
throw new NotSupportedException("This API is not supported in desktop mode.");
383+
throw new NotSupportedException("This API is no longer supported.");
384384
}
385385

386386
XYFocusOptions xyFocusOptions = new XYFocusOptions();
@@ -395,7 +395,7 @@ private static IAsyncOperation<FocusMovementResult> TryFocusAsyncImpl(
395395
if (InIslandsMode())
396396
{
397397
// This api is not supported in islands/ desktop mode.
398-
throw new NotSupportedException("This API is not supported in desktop mode.");
398+
throw new NotSupportedException("This API is no longer supported.");
399399
}
400400

401401
Rect hintRect = focusHintRectangle;
@@ -690,7 +690,7 @@ internal static bool SetFocusedElementWithDirection(
690690
// Return error if FindNextElement is called without focus navigation option in islands/desktop
691691
if (typeof(FocusManager).Log().IsEnabled(LogLevel.Error))
692692
{
693-
typeof(FocusManager).Log().LogError("FindNextElement override with FindNextElementOptions must be used in WinUI Desktop apps.");
693+
typeof(FocusManager).Log().LogError("FindNextElement override with FindNextElementOptions must be used instead.");
694694
}
695695
return null;
696696
}

0 commit comments

Comments
 (0)