prism的模块加载,分为按需加载和自动加载,在wpf项目中,自动加载是在主窗体初始化完成才进行,如果主窗体的viewmodel依赖于某个模块,可以在主窗体InitializeComponent()方法之前指定加载该模块,这样viewmodel实例化时就能正常使用模块了。

Comments

Be the first to post a comment

Post a comment