Closed Postlagerkarte closed 2 years ago
Daniel,
Brilliant - I'm happy to have been proved wrong! I've just run some quick tests and it looks to cover all the bases. Having had a lot of people looking at it, I didn't think it was possible without upsetting the Blazor JS code.
I'm planning to do more in-depth testing tomorrow and incorporate it into a demo project.
Can I include this in my latest Blazor Edit Form code release? If so what copyright header notice do you want?
@ShaunCurtis: you can use or modify the code freely, no need for any credits. If you want, you can find me on linked-in. I'm not sure this works all the time, so be careful. I just wrote it today.
Daniel,
Did you test this in WASM? It works great in Server, but I'm having issues in WASM.
Given there are some challenges to supporting this feature as-is across different flavors of Blazor, our team is trying trying to gauge if a more limited solution would suffice here based on this feature spec: https://github.com/dotnet/aspnetcore/issues/40149. Could you look at it and give us feedback? Thanks!
The NavigationManager exposes
LocationChanged | An event that fires when the navigation location has changed.
but it does not expose a
LocationChanging
event.Such an event that occurs before navigation takes place is very useful because it allows the previous view to prepare for its deactivation, for example, to display a warning, cancel navigation or silently save changes.
Can you provide such a feature or is there already another way to achieve the above?