Replies: 1 comment
-
I was able to use CommunityToolKit.MVVM.Messaging so each viewmodel can send a message to the MainWindowViewModel when it's busy and wants to block navigation. MainWindowViewModel will then set its CanNavigate property to false. My MainWindow code behind wires to the RootNavigation_Navigating event:
Has anyone got a suggestion to improve this? Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First off, many thanks to @pomianowski and other contributors for creating and maintaining this solution, your work is very much appreciated!!
My question is: Is there a way for a view model to disable or cancel navigation? If a user is in the middle of editing, I want them to either save or discard changes before moving to another screen. Maybe I could disable the navigation menu when editing starts, or wire into an event to cancel it? Hopefully I'm missing something easy, any suggestions are appreciated.
Beta Was this translation helpful? Give feedback.
All reactions