I’m building a WPF navigation app, with pages.
I want to ask the user if he want to save the changes when he leaves a page.
Is there a way to do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Register for the
NavigationService.Navigatingevent. Don’t forget to remove your registration when you are done, sinceNavigationServicesticks around basically forever.When you get the Navigating event and there are changes, show a MessageBox to confirm with the user or give them a chance to save their data. If they hit Cancel, set
e.Cancel = trueto cancel the navigation.