From 494901b52d32eaa02a07301bea715a5d28d7d646 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Tue, 7 Oct 2025 19:29:18 -0500 Subject: [PATCH] CmdPal: immediately move to page, while loading (#42227) Regressed in #41358 We're synchronously waiting for the first FetchItems to return before actually navigating to the page. Yikes. Closes #42157 drive-by: Closes #42231 Closes #42156 --- .../Core/Microsoft.CmdPal.Core.ViewModels/ShellViewModel.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/cmdpal/Core/Microsoft.CmdPal.Core.ViewModels/ShellViewModel.cs b/src/modules/cmdpal/Core/Microsoft.CmdPal.Core.ViewModels/ShellViewModel.cs index bfda24f7ea..18d4dd02ba 100644 --- a/src/modules/cmdpal/Core/Microsoft.CmdPal.Core.ViewModels/ShellViewModel.cs +++ b/src/modules/cmdpal/Core/Microsoft.CmdPal.Core.ViewModels/ShellViewModel.cs @@ -206,11 +206,14 @@ public partial class ShellViewModel : ObservableObject, .ContinueWith( (Task t) => { + // When we're done loading the page, then update the command bar to match OnUIThread(() => { WeakReferenceMessenger.Default.Send(new(null)); }); - WeakReferenceMessenger.Default.Send(new(pageViewModel, message.WithAnimation)); }, _scheduler); + // While we're loading in the background, immediately move to the next page. + WeakReferenceMessenger.Default.Send(new(pageViewModel, message.WithAnimation)); + // Note: Originally we set our page back in the ViewModel here, but that now happens in response to the Frame navigating triggered from the above // See RootFrame_Navigated event handler. }