xamarin/Xamarin.Forms

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

开放

#7,733 创建于 2019年9月29日

 (8 条评论) (0 个反应) (0 位负责人)C# (1,926 个派生)batch import
a/lifecycleeventshelp wantedp/Androidt/bug :bug:up-for-grabs

仓库指标

星标
 (5,644 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南