简体   繁体   中英

Xamarin Web container avoid back button close the application

I'm new to Xamarin, I'm using this example as a base for my on application. I just noticed when I click back button the application get closed, I would like to avoid that.

do you have some hints and recommendations, maybe examples?

In your Content Page who will have to override the OnBackButtonPressed event and return true. You must return true because it signifies that the developer has handled the implementation of the back button click.

protected override bool OnBackButtonPressed()
{
    return true;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM