Open BrayanKhosravian opened 4 years ago
the same applies to modal navigation
FYI @bruzkovsky @gentledepp
i think this issue can be resolved by calling Element.OnDisappearing()
in the Xamarin.Forms.Platform.UWP.MasterDetailPageRenderer.Dispose
method
public void Dispose()
{
ClearMaster();
ClearDetail();
Tracker = null;
if (Element != null)
{
Element.SendDisappearing(); // <= Add this
SetElement(null);
}
}
@gentledepp found that out after a search
here is the branch i was working on: https://github.com/BrayanKhosravian/Xamarin.Forms/tree/bug-uwp-10413-ondisappearing-notcalled-after-popasync-in-masterdetail
i already created an issue in the control gallery. you could just pick my commit if that helps. Wasnt able to push the branch to upstream as i dont have premissions.
Description
ContentPage
which is wrapped with aNavigationPage
navigation.PushAasync
and pushes a newMasterDetailPage
Navigation.PopAsync
OnDisappearing
of theMasterDetailPage
is not called The OnDisappearing is actually being called on Android. Didnt tested in for iOS!Steps to Reproduce
MasterDetailUwpOnDisappearing.Views.MainPage.OnDisappearing
OnDisappearing
is not called on UWPExpected Behavior
OnDisappearing
should be called when popping the master detail page from the navigationstack like it is called on androidActual Behavior
OnDisappearing
is not called when popping the masterdetail page from the navigations tack on uwpBasic Information
Screenshots
Reproduction Link
https://github.com/Xamarin-Forms-Issues-Repro/MasterDetailUwpOnDisappearing
Workaround
none