在带有 Prism 和 Unity 的 Xamarin.Forms 中,有没有办法注册所有受导航影响的视图而不明确指定它们?
Prism 提供的示例项目,在 App.xaml.cs 中有一个函数 RegisterTypes,它具有以下行:
Container.RegisterTypeForNavigation<MainPage>();
我希望这在开发应用程序的某个时候会更大。
我不是 Unity 专家,但我尝试了 DependencyService 或 IUnityContainer 的一些方法,但没有成功。
Container.Registrations.Where(cm => cm.RegisteredType == typeof (IView));
Container.ResolveAll<IView>();
DependencyService.Get<IEnumerable<IView>>();
那么我将如何注册所有视图(或至少是视图的子集,例如,实现给定接口)以进行导航?