Bug 60589 - Unexpected call to OnDisappearing on UWP when using NavigationPage
Summary: Unexpected call to OnDisappearing on UWP when using NavigationPage
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.5.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-11-09 09:27 UTC by René
Modified: 2018-02-01 17:31 UTC (History)
12 users (show)

Tags: xamextfollowed, onappearing, ondisappearing, ac, fr
Is this bug a regression?: ---
Last known good build:

Demo project (61.99 KB, application/zip)
2017-11-09 09:35 UTC, René

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:

Description René 2017-11-09 09:27:53 UTC

Windows, VS2017, Xamarin.Forms project based on .NET Standard


- Create a blank Forms app and add UWP as a target platform. 
- In the generated Mainpage.cs override OnAppearing() and OnDisappearing() and put log statements into them
- In Main.xaml.cs set the MainPage property to a "new NavigationPage(new MainPage())"
- Run the app on Windows 10 locally
- Notice how OnAppearing() is called, followed immediately by OnDisappearing()


Correct call of lifecycle methods. OnDisappearing should not be called in this scenario. 

Other observations:

- Removing the NavigationPage() fixes the problem

Demo project is attached.
Comment 1 René 2017-11-09 09:35:19 UTC
Created attachment 25617 [details]
Demo project
Comment 2 Douglas Winter 2017-12-13 12:43:20 UTC
I know that it is confirmed, but since I'm having this issue I just would like to +1 here :)
Comment 3 Runar Jordahl 2018-01-10 12:38:44 UTC
+1 for this. I struggled long and hard with this issue.
Comment 4 Michael Rumpler 2018-01-18 12:17:44 UTC
I also stumbled over this. As I already built a repro project before searching here, I also raised a GitHub Issue https://github.com/xamarin/Xamarin.Forms/issues/1602. Maybe that makes them more aware of the problem.
Comment 5 Rui Marinho 2018-01-24 10:17:42 UTC
Should be fixed on 2.6.0-pre1
Comment 6 Samantha Houts [MSFT] 2018-02-01 17:31:53 UTC