Not sure how to handle all click events in a Blazor application from a single place. Also one can't prevent navigation from a bubbling DOM event in Blazor. Has to all be done from JavaScript. All in all it reminds me of onbeforeunload which is a horrible way to do that. Frankly speaking I don't think this feature can be implemented in such a global and invasive way.
Probably one can handle the Then event of the edit dialog and display some notification if the record hasn't been saved. The dialog result can be used for that.