Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide Access to RegisterLocationChangingHandler on the Router to allow centrally managed logic #59697

Open
1 task done
andrewwilkin opened this issue Jan 2, 2025 · 0 comments
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@andrewwilkin
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

1 participant