xamarin/Xamarin.Forms

[Bug] Disappearing event behavior during backgrounding not consistent between the platforms.

Aperta

#7733 aperta il 29 set 2019

 (8 commenti) (0 reazioni) (0 assegnatari)C# (1926 fork)batch import
a/lifecycleeventshelp wantedp/Androidt/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Description

I tried three methods to handle page Disapearing.

In the code

this.Disappearing += MainPage_Disappearing;

Overriding

protected override void OnDisappearing()
{
   Debug.WriteLine("OnDisappearing()");

   base.OnDisappearing();
}

And the event handler from XAML

private void ContentPage_Disappearing(object sender, EventArgs e)
{
    Debug.WriteLine("ContentPage_Disappearing()");
}

Neither of the three handler is called on UWP and WPF. They were called all three on Android.

Steps to Reproduce

Basicaly generate a new XF solution and implement the Disappearing handlers.

The test solution is attached.

XFBug_UWP_OnDisappearing.zip

Guida contributor