BurkusCat / Burkus.Mvvm.Maui

A simple MVVM framework for .NET MAUI. It provides: navigation, lifecycle events, parameter passing, native dialog abstractions, and testability.
MIT License
24 stars 5 forks source link

[Feature] Navigation Guards #28

Open BurkusCat opened 9 months ago

BurkusCat commented 9 months ago

Is your feature request related to a problem? Please describe. If I have unsaved changes on a page, I want to prevent the user from leaving it unless they confirm in a dialog they want to discard the changes. If a navigation initiates to an authenticated part of the app, I want to prevent the user from being allowed to navigate to that page unless they are first logged in.

Describe the solution you'd like Something like Angular's route guards https://angular.io/api/router/CanActivate https://angular.io/api/router/CanDeactivate

Describe alternatives you've considered N/A

Proposed APIs If possible, try to propose how the API might look. For example:

Task<bool> CanNavigateFrom()
Task<bool> CanNavigateTo()

Additional context N/A