Provide Access to RegisterLocationChangingHandler on the Router to allow centrally managed logic #59697
Open
1 task done
Labels
area-blazor
Includes: Blazor, Razor Components
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
I want to write logic centrally managed logic to intercept and manipulate navigation. All the examples are for use in individual razor pages, and want to write this once without polluting the rest of the app.
The Router provides access to LocationChanged event in the NavigationManager. However this cannot be used to invoke NavigateTo on the NavigationManager, perhaps because it happens too late in the cycle with pre-rendering.
Describe the solution you'd like
Provide the ability to pass in a handler to the Router as a parameter, similar to OnNavigateAsync, that registers the handler with RegisterLocationChangingHandler on the NavigationManager.
Additional context
No response
The text was updated successfully, but these errors were encountered: