Page.OnBackButtonPressed Method

Definition

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

Boolean

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.

Applies to