How do I navigate back without losing the title bar or going through all the previous pages first?
Is there any way to skip all of the "inbetween" pages and navigate straight back to the first page from the last page in the navigation stack in my .NET MAUI application? (and doing this without showing the animations of all the previous "modal style" pages?)
Here's what I am trying to do:个
ItemDetailsPage
/
/
ItemListPage /
\
\
\
NewItemStep1 ____ NewItemStep2 ____ NewItemStep3 ____ ItemDetailsPage
从ItemListPage
人中,你可以做两件事:
- 在
ItemDetailsPage
或...上显示商品 - 用3个步骤创建一个新项目:从
NewItemStep1
到NewItemStep2
再到NewItemStep3
,最后到ItemDetailsPage
,显示您新创建的新项目.
现在,我想要从ItemDetailsPage
返回到ItemListPage
,而不是使"介于"模式样式的页面具有动画效果.因此,基本上只需直接转到一个新页面并对其进行动画处理,但不要以动画方式删除导航堆栈中介于两者之间的任何其他页面.
Here's what I've tried so far:
On the last page (Step 3 page):
Dictionary<string, object> Params = new() {
{"Item", Item }
};
await Shell.Current.GoToAsync($"{nameof(ItemDetailsPage)}", Params);
这将导航到ItemDetailsPage
,并如预期的那样显示创建的项目!但现在ItemDetailsPage
没有标题栏,因此根本没有后退按钮来返回任何页面.我认为这在某种程度上扰乱了导航堆栈.
Dictionary<string, object> Params = new() {
{"Item", Item }
};
await Shell.Current.GoToAsync($"//{nameof(ItemListPage)}");
await Shell.Current.GoToAsync($"{nameof(ItemDetailsPage)}", Params);
这将导航到ItemDetailsPage
也显示创建的项目,with标题栏(和后退按钮)直接返回ItemListPage
.太棒了!但这样做将从all the way back转到Step3
,然后是Step2
,然后是Step1
,然后是ItemListPage
,显示所有这些页面都是屏幕上的动画,最后以ItemDetailsPage
结束,以显示所创建的项目.这就是我希望它如何工作,但without通过前面的(1,2,3)步页面首先.