views:

21

answers:

0

I've written my first WPF 4.0 application. It is a page-based app (not an XBAP app). The user searches for some items on the first page, and selects something found to go to the second page. On the second page users will enter more data, save it, and returned to the first page to start the process over again.

The majority of my users have no difficulty with this. However, I've got one user who, for some reason, thinks that the back button on the page is meant to go to the top of the page. She'll click on it, which returns her to the first page, and then she's confused because now she's not at the top of the second page, etc. Long story.

Anyway, I'd like a way of querying her before allowing her to navigate backward, if the changes she's made haven't yet been saved. She would have the choice of either ignoring a message box telling her that data hasn't been saved or not, but she'll know that she's trying to move off before saving the data, and can stop navigating backward if she realizes her mistake. I've been looking at the events for the Page class, but don't see what I'm looking for. For example, in VB6 here is a QueryUnload event for the form. One could write logic in that event which would allow you to pop up a message box, asking the user if they wanted to do something (e.g.: save the data). In looking at all of the events for the Page class in VS 2010, I don't see anything quite like a QueryUnload event. So, how do I do what I'm trying to do?