Prism.Forms 导航 - 在模式页面和非模式页面之间
Prism.Forms Navigation - Between Modal and Non Modal Pages
我有一个有很多页面的应用程序,并且在模式页面和非模式页面之间启用了导航。但是不知何故,每当我尝试将 useModalNavigation 属性 设置为 false 时,它似乎都不起作用。模式类型导航抑制了实际的页面导航。现在我的应用程序可以在模式和根页面之间导航。有出路吗?
我的 app.xaml.cs 有
await NavigationService.NavigateAsync(new Uri($https://NavigationPage/{nameof(MyMainPage)}", UriKind.Absolute));
在 MyMainPage 中,我有一个进一步打开内容页面的按钮。
为此,我有一个委托命令,它在下面调用以在单击按钮时导航到内页:
navigationService.NavigateAsync("MyInnerPage", useModalNavigation:false);
According to the Xamarin docs, 无法离开模态页面是预期行为:
A modal page encourages users to complete a self-contained task that
cannot be navigated away from until the task is completed or
cancelled.
您需要弹出模态页面才能再次导航:
await Navigation.PopModalAsync();
如果您想离开此页面,请不要使用模态导航。
我有一个有很多页面的应用程序,并且在模式页面和非模式页面之间启用了导航。但是不知何故,每当我尝试将 useModalNavigation 属性 设置为 false 时,它似乎都不起作用。模式类型导航抑制了实际的页面导航。现在我的应用程序可以在模式和根页面之间导航。有出路吗?
我的 app.xaml.cs 有
await NavigationService.NavigateAsync(new Uri($https://NavigationPage/{nameof(MyMainPage)}", UriKind.Absolute));
在 MyMainPage 中,我有一个进一步打开内容页面的按钮。 为此,我有一个委托命令,它在下面调用以在单击按钮时导航到内页: navigationService.NavigateAsync("MyInnerPage", useModalNavigation:false);
According to the Xamarin docs, 无法离开模态页面是预期行为:
A modal page encourages users to complete a self-contained task that cannot be navigated away from until the task is completed or cancelled.
您需要弹出模态页面才能再次导航:
await Navigation.PopModalAsync();
如果您想离开此页面,请不要使用模态导航。