Page.OnBackButtonPressed Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Application developers can override this method to provide behavior when the back button is pressed.
protected virtual bool OnBackButtonPressed ();
abstract member OnBackButtonPressed : unit -> bool
override this.OnBackButtonPressed : unit -> bool
Returns
Whether or not the back navigation was handled by the override.
Remarks
If you want to handle or cancel the navigation yourself, you can do so in this method and then return true.
Note that this only works on Android and UWP for the hardware back-button. On iOS, this method will never be called because there is no hardware back-button.