{"record":{"id":"efc788bff2031a6b","repo":"dotnet/maui","slug":"push-is-not-supported-globally-on-windows-please","errorCode":null,"errorMessage":"Push is not supported globally on Windows, please use a LightNavigationPage.","messagePattern":"Push is not supported globally on Windows, please use a LightNavigationPage\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Compatibility/Core/src/WPF/Interfaces/IFormsNavigation.cs","lineNumber":91,"sourceCode":"\t\tpublic void PopToRoot()\n\t\t{\n\t\t\tPopToRoot(true);\n\t\t}\n\n\t\tpublic void PopToRoot(bool animated)\n\t\t{\n\t\t\tthrow new InvalidOperationException(\n\t\t\t\t\"PopToRoot is not supported globally on Windows, please use a LightNavigationPage.\");\n\t\t}\n\n\t\tpublic void Push(object page)\n\t\t{\n\t\t\tPush(page, true);\n\t\t}\n\n\t\tpublic void Push(object page, bool animated)\n\t\t{\n\t\t\tthrow new InvalidOperationException(\"Push is not supported globally on Windows, please use a LightNavigationPage.\");\n\t\t}\n\n\t\tpublic void PushModal(object page)\n\t\t{\n\t\t\tPushModal(page, true);\n\t\t}\n\n\t\tpublic void PushModal(object page, bool animated)\n\t\t{\n\t\t\tParentWindow?.PushModal(page, animated);\n\t\t}\n\n\t\tpublic void RemovePage(object page)\n\t\t{\n\t\t\tthrow new InvalidOperationException(\n\t\t\t\t\"RemovePage is not supported globally on Windows, please use a LightNavigationPage.\");\n\t\t}\n","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/src/Compatibility/Core/src/WPF/Interfaces/IFormsNavigation.cs#L73-L109","documentation":"IFormsNavigation.Push (and Push(bool)) throw InvalidOperationException stating Push is not supported globally on Windows and instructs to use a LightNavigationPage. The FormsWindow-level navigation proxy rejects stack pushes; only a LightNavigationPage implements them. (PushModal is supported at the window level and delegates to ParentWindow.)","triggerScenarios":"Calling Navigation.PushAsync(page) against the FormsWindow navigation proxy; pushing pages without a LightNavigationPage container; shared code that pushes via the global proxy.","commonSituations":"Cross-platform navigation pushing pages directly; embedding pages without a NavigationPage wrapper on WPF.","solutions":["Wrap pages in a LightNavigationPage and push via that instance.","Branch shared code by platform: use LightNavigationPage on WPF.","Verify the navigation proxy resolves to a page-level NavigationPage, not the window.","Use PushModalAsync for window-level modal pushes if that matches intent."],"exampleFix":"// before\nawait Navigation.PushAsync(new ContentPage());\n\n// after\nif (Navigation is LightNavigationPage lnp)\n    await lnp.PushAsync(new ContentPage());","handlingStrategy":"type-guard","validationCode":"if (Navigation is LightNavigationPage lnp) await lnp.PushAsync(page);\nelse throw new PlatformNotSupportedException(\"Use LightNavigationPage on WPF.\");","typeGuard":"static bool CanPush(NavigationProxy n) => n is LightNavigationPage;","tryCatchPattern":"try { await Navigation.PushAsync(page); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"LightNavigationPage\"))\n{ /* wrap in LightNavigationPage, retry */ }","preventionTips":["Wrap pages in LightNavigationPage for stack pushes on WPF.","Use PushModalAsync for window-level modal pushes if appropriate.","Branch shared navigation by platform."],"tags":["wpf","navigation","not-supported","light-navigation-page"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}