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.
Currently, the OnAppearing and OnDisappearing methods are often used to perform jobs relating to the transfer of data between pages during page navigation. However, the order of calls to these two methods is not consistent. It varies by platform and whether modal or modeless navigation is occurring. On iOS, Android, and WP Silverlight, the PushAsync or PopAsync tasks complete after the calls to OnAppearing and OnDisappearing. On the Windows Runtime platform, this is not so. All these differences can be explored with the following program:
That program uses Debug.WriteLine to log the various calls to OnAppearing and OnDisappearing, and the completion of the Push and Pop tasks.
In addition, there are anomalies on several platforms:
On iOS, OnDisappearing is called on the current page when the program is terminating.
On Android, PushModalAsync is not accompanied by a call to OnDisappearing, and PopModalAsync does not cause a corresponding call to OnAppearing in the page being returned to.
On Windows Phone Silverlight, the DatePicker, TimePicker, and Picker all cause calls to OnDisappearing when they are invoked, and OnAppearing when they return to the page from which they were invoked.
All these issues complicate the transfer of data between pages. A protected virtual method specifically indicating page navigation would be very useful. It could have the following signature:
protected virtual NavigationCompleted(Page pageFrom, Page pageTo)
The method would be called in both pages involved in the page navigation in a fixed order but with the same arguments. An override of the method in a particular page could determine if the page was being navigated to or from by comparing the values of the two arguments with its own instance.
Thank you for taking the time to submit this feature request. We like this idea and have added it to our internal feature tracking system.
Xamarin Forms Team