xamarin/Xamarin.Forms

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

Ouverte

#7 733 ouverte le 29 sept. 2019

 (8 commentaires) (0 réaction) (0 personne assignée)C# (1 926 forks)batch import
a/lifecycleeventshelp wantedp/Androidt/bug :bug:up-for-grabs

Métriques du dépôt

Stars
 (5 644 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur