Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
When the application is exited using the device's back button, the page's OnDisappearing is not called.
I'm presently experiencing some oddities with deploying to device but I believe I recently checked this and noticed it was an issue, so I will set to assigned for now so it can be double checked and looked into further when things aren't acting up.
OnDisappearing is also not called when the user exits a UWP app.
To clarify, I'm referring to the case of clicking the Close button in the upper right of a windowed UWP app. OnDisappearing does not get called in this case.
This a normal behavior as the app is being closed (going to background) same behavior is similar in all platforms.
You should use OnSleep on the Application class for anything you need to do at that time.
At the very least, the documentation for OnDisappearing should state this behavior. What else should a developer expect except that OnDisappearing should be called when the app (and hence the page along with it)... well... umm... disappears?
The method description "When overridden, allows the application developer to customize behavior as the Page disappears." (https://developer.xamarin.com/api/member/Xamarin.Forms.Page.OnDisappearing/) makes it sound like the method does exactly what you'd expect. If you really don't want the framework to work that way, please document whatever the funky behavior is, so that we developers can anticipated it.
Even better would be to put the smarts in so that OnDisappearing is always called when a page disappears. Application.OnSleep is fine for application-level actions, but it lacks context for page-level actions. It also doesn't work well for actions that aren't affected by the reason the page is disappearing.