C# 棱镜4+;Mef+;公共部分类App=Bag?
我正在尝试实现接口iPartimportSSatifiedNotification,但不幸的是,它不起作用。 这只虫子我只有棱镜。我不明白为什么会这样C# 棱镜4+;Mef+;公共部分类App=Bag?,c#,mef,prism-4,C#,Mef,Prism 4,我正在尝试实现接口iPartimportSSatifiedNotification,但不幸的是,它不起作用。 这只虫子我只有棱镜。我不明白为什么会这样 你在释放模式下运行吗?由于内部没有逻辑,编译器是否可能忽略对OnImportSuited的任何调用?不,我正在调试模式下工作。我将方法添加到plugin.TestMetod();。但不幸的是,这不起作用。 public partial class App : Application, IPartImportsSatisfiedNotificat
你在释放模式下运行吗?由于内部没有逻辑,编译器是否可能忽略对OnImportSuited的任何调用?不,我正在调试模式下工作。我将方法添加到plugin.TestMetod();。但不幸的是,这不起作用。
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;
}
}