我需要 Blend 4 调用一些初始化代码,然后它才能合理地显示我的应用程序,我正在使用Josh Smith 的这种方法来完成它。
我正在使用以下项目结构:
MainProgram
-- Properties
-- AssemblyInfo.cs (including the custom attribute)
-- App.xaml
-- HostWindow.xaml (UserControls are embedded here)
-- DesignTimeBootstrapperAttribute.cs
ViewsAssembly
-- Lots of user controls
出于某种原因,每次构建后都不会调用设计时引导程序(导致我的自定义标记扩展在 Blend 中引发异常和大量错误消息)。但是,在最初加载解决方案时会调用它,我不明白 Blend 在这里的行为方式。
我做错了什么,还是有其他方法?
编辑: 我注意到进行完整的重建每次都会调用 Bootstrapper。也许这可以作为一种解决方法,但我仍然想理解它。