【问题标题】:How to save the information on a Page when traveling from one detail page to another从一个详细信息页面到另一个详细信息页面时如何保存页面上的信息
【发布时间】:2020-02-19 02:01:55
【问题描述】:

我正在使用 Xamarin.Forms,并且正在尝试以 Master-Detail 格式实现我的多页表单。当我从母版页菜单中单击另一个页面时,我想确保在我前往下一个详细信息页面之前,将当前详细信息页面上的信息保存到移动设备上的相应数据库表中。关于如何实现这一目标的任何想法?

【问题讨论】:

标签: xamarin xamarin.forms master-detail


【解决方案1】:

你看过 OnDisappearing() 方法吗?

protected override void OnDisappearing()
{
    //Your code before you switch to another page
}

【讨论】:

    【解决方案2】:

    嗨@lovetolearn你可以实现每个页面的OnDisappearing()方法。

    protected override void OnDisappearing()
    {
        //Your code before you switch to another page
    }
    

    【讨论】:

      猜你喜欢
      • 2021-10-17
      • 2012-03-25
      • 1970-01-01
      • 2016-10-07
      • 1970-01-01
      • 2015-03-30
      • 1970-01-01
      • 2016-09-03
      • 2019-08-23
      相关资源
      最近更新 更多