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.
Determines the behavior when the back button of the page is pressed.
protected:
virtual bool OnBackButtonPressed();
protected virtual bool OnBackButtonPressed ();
abstract member OnBackButtonPressed : unit -> bool
override this.OnBackButtonPressed : unit -> bool
Protected Overridable Function OnBackButtonPressed () As Boolean
Returns
true
when the back navigation was handled by the override, otherwise false
.
Remarks
Application developers can override this method to provide behavior when the back button is pressed. When overridden to handle or cancel the navigation yourself, this method should return true
.
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.