Set flyoutPage.Detail = NavigationPage(page1) (In my particular case, the detail pages are nested in another Navigation page, but this should not matter regarding reproducing the issue)
Set flyoutPage.Detail = NavigationPage(page2)
The page1 has its OnDisappearing overridden: Calls base and logs call.
Expected Behavior
Observe both the page's own OnDisappearing call, as well as the app's PageDisappearing event.
Description
I don't have the time right now to prepare a minimal reproduction sample or fill in all the details of the issue template. I tested this on Android.
Steps to Reproduce
app.PageDisappearing
event: Log event.app.MainPage = NavigationPage(FlyoutPage)
flyoutPage.Detail = NavigationPage(page1)
(In my particular case, the detail pages are nested in another Navigation page, but this should not matter regarding reproducing the issue)flyoutPage.Detail = NavigationPage(page2)
page1
has its OnDisappearing overridden: Calls base and logs call.Expected Behavior
Observe both the page's own OnDisappearing call, as well as the app's PageDisappearing event.
Actual Behavior
Only observe the page's own OnDisappearing call.
Analysis
My guess is that the Detail page is no longer a child of the FlyoutPage at the time its
SendDisappearing
is invoked: SettingDetail
removes the old page from the parents (https://github.com/xamarin/Xamarin.Forms/blob/5.0.0/Xamarin.Forms.Core/FlyoutPage.cs#L46). Only afterwards, the Android FlyoutPage renderer is notified, which updates the platform view (https://github.com/xamarin/Xamarin.Forms/blob/5.0.0/Xamarin.Forms.Platform.Android/AppCompat/FlyoutPageRenderer.cs#L481), which eventually results in the old page'sSendDisappearing
to be invoked.SendDisappearing can call the page's
OnDisappearing
, but is not able to find the application on which to call thePageDisappearing
event: https://github.com/xamarin/Xamarin.Forms/blob/5.0.0/Xamarin.Forms.Core/Page.cs#L478