Prism 4 + Mef + public partial class App = Bag?

时间:2011-10-09 08:22:41

标签: c# mef prism-4

我正在尝试实现接口IPartImportsSatisfiedNotification,但遗憾的是它不起作用。 这个bug我只有棱镜。我不明白为什么会这样。

Test Application

public partial class App : Application, IPartImportsSatisfiedNotification
{
    [Import]
    public IPlugin plugin { get; set; }

    protected override void OnStartup(StartupEventArgs e)
    {
        base.OnStartup(e);
        var bootstrapper = new Bootstrapper();
        bootstrapper.Run();
    }

    public void OnImportsSatisfied() // This code is not called
    {
        var x = plugin;
    }
}

0 个答案:

没有答案