贝娄你可以看到我的引导程序。我想从引导程序注册所有视图。当我启动应用程序时,会创建 WebView 和 EditView。GeneralView 是 EditView 的一部分,我必须先导航到 EditView 才能实例化它。启动可执行文件时如何实例化所有视图?
class Bootstrapper : UnityBootstrapper
{
protected override DependencyObject CreateShell()
{
// Register views
IRegionManager regionManager = this.Container.Resolve<IRegionManager>();
regionManager.RegisterViewWithRegion("ContentRegion", typeof(WebView));
regionManager.RegisterViewWithRegion("ContentRegion", typeof(EditView));
// The following view is instantiated for the first time when I navigate to EditView
regionManager.RegisterViewWithRegion("GeneralRegion", typeof(GeneralView));
return Container.Resolve<MainWindow>();
}
protected override void InitializeShell()
{
Application.Current.MainWindow.Show();
}
protected override void InitializeModules()
{
base.InitializeModules();
}
}
MM们
相关分类