在非Prism WPF应用程序中,如果我想在初始化后运行代码(例如执行命令行参数指定的任务),我可以Loaded在主窗口的情况下执行此操作.但是对于Prism,模块在显示主窗口后初始化,即IModule.Initialize()在Bootstrapper.CreateShell()和之后调用Bootstrapper.InitializeShell().在这种情况下,我应该使用哪个事件/覆盖?
调用的最后一件事UnityBootstrapper.Run(bool runWithDefaultConfiguration)是InitializeModules()(除了调用Logger.Log之外).所以在Run(...)之上.
class Bootstrapper : UnityBootstrapper
{
...
public override void Run(bool runWithDefaultConfiguration)
{
base.Run(runWithDefaultConfiguration);
// modules (and everything else) have been initialized when you get here
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1653 次 |
| 最近记录: |