从导航堆栈中删除页面 - xamarin.forms [英] Remove page from Navigation stack - xamarin.forms

查看:106
本文介绍了从导航堆栈中删除页面 - xamarin.forms的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序结构中,如下所示,列表页面 -> 详情页面 -> 编辑页面

In my app structure is like below, List Page -> Detail Page -> Edit Page

在编辑页面有删除"按钮,可以从数据库中删除数据.

and in edit page there is button "Delete" which removes data from database.

现在我的问题是将用户从编辑页面导航到列表页面,

Now my problem is to navigate user from Edit page to List Page,

为此我使用了 Navigation.popasync 2 次,但在详细信息页面上,我收到来自服务的错误消息,不存在此类记录.

I'm using Navigation.popasync 2 times for this, but on detail page i'm getting error from service that no such record exist.

如何正确地将用户从编辑页面导航到列表页面?

How can i properly navigate user from Edit page to list page?

推荐答案

// Remove page before Edit Page
this.Navigation.RemovePage (this.Navigation.NavigationStack [this.Navigation.NavigationStack.Count - 2]);
// This PopAsync will now go to List Page
this.Navigation.PopAsync ();

这篇关于从导航堆栈中删除页面 - xamarin.forms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆