WPF/Prism应用程序初始化完成后的事件

NS.*_*.X. 3 wpf prism

在非Prism WPF应用程序中,如果我想在初始化后运行代码(例如执行命令行参数指定的任务),我可以Loaded在主窗口的情况下执行此操作.但是对于Prism,模块在显示主窗口后初始化,即IModule.Initialize()Bootstrapper.CreateShell()和之后调用Bootstrapper.InitializeShell().在这种情况下,我应该使用哪个事件/覆盖?

Phi*_*hil 5

调用的最后一件事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)