Xamarin.Forms Routing.RegisterRoute() 不注册任何更改



我在AppShell.xaml.cs 中有路由注册表

public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();

BindingContext = App.Container.Resolve<AppShellViewModel>();
Routing.RegisterRoute(nameof(AdvertismentDetailViewModel), typeof(AdvertisementDetailPage));
Routing.RegisterRoute(nameof(LoginViewModel), typeof(LoginPage));
Routing.RegisterRoute(nameof(UserDetailViewModel), typeof(UserDetailPage));
Routing.RegisterRoute(nameof(AdvertismentListViewModel), typeof(AdvertisementDetailPage));
Routing.RegisterRoute(nameof(RegisterViewModel), typeof(RegisterPage));
Routing.RegisterRoute(nameof(UserProfileViewModel), typeof(UserProfilePage));
Routing.RegisterRoute(nameof(MyAdvertisementsListViewModel), typeof(MyAdvertisementsListPage));
Routing.RegisterRoute(nameof(MyAdvertisementDetailViewModel), typeof(MyAdvertisementDetailPage));
Routing.RegisterRoute(nameof(PublisherChatViewModel), typeof(PublisherChatView));
Routing.RegisterRoute(nameof(YekkaDetailViewModel), typeof(YekkaDetailPage));
Routing.RegisterRoute(nameof(ForgotPasswordViewModel), typeof(ForgotPasswordPage));
}
}

现在,如果我添加新路由或将其全部删除,则将不会产生任何效果我在添加最后一条路线时注意到了这一点。我已经重建,删除了bin,obj文件夹。谢谢:(

解决方案是在测试设备上重新安装应用程序。

相关内容

  • 没有找到相关文章

最新更新