Just like this:
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e) { // to cancel the event e.Cancel = true; }You can optionally cancel the navigation or allow it to occur.
You cancel the navigation by calling the instruction on line four.
Obviously you can code any logic to conditionally cancel the navigation.
Another use is to catch the event just to persist any information and then letting the navigation occur.
No comments:
Post a Comment