我正在使用 shell,我想转到此页面:
public AppManagementPage(
IMainThread mainThread,
IAnalyticsService analyticsService,
AppManagementPageViewModel appManagementPageViewModel) : base(appManagementPageViewModel, analyticsService, mainThread)
{
通常我一直在以通常的方式定义一条路线,并且只使用这个命令。
Routing.RegisterRoute("App/AppManagementPage", typeof(AppManagementPage));
await Shell.Current.GoToAsync("App/AppManagementPage", true);
但是,由于我需要 DI 来填充我正在使用的所有参数 Microsoft.Extensions.DependencyInjection 我首先需要获得这样的参考页面:
var myAppManagementPage = Startup.ServiceProvider.GetRequiredService<AppManagementPage>();
然后我需要打开这个新页面:myAppManagementPage
您能否帮助解释/建议我如何在不使用 Shell 的情况下导航到 myAppManagementPage?