【发布时间】:2014-02-03 23:07:22
【问题描述】:
如何在 WindowsForms 项目中使用 UnityBootStrapper 托管 WPF Prism 应用程序?
我在 Windows 窗体宿主项目中添加了对以下 wpf 程序集的引用
PresentationCore
PresentationFramework
WindowsBase Ayatem.xaml
WindowsFormsIntegration.dll
Microsoft.Practices.Prism.UnityExtensions
并且我已经删除了 Prism 项目的 app.xaml 文件。 在 win 表单的 ElementHost 控件中,我试图填充 shell,但它不加载模块。
//Create the ElementHost control for hosting the WPF UserControl
ElementHost host = new ElementHost();
host.Dock = DockStyle.Fill;
//Create the WPF UserControl.
HelloWorld.Shell uc = new HelloWorld.Shell();
//Assign the WPF UserControl to the ElementHost control's Child property.
host.Child = uc;
//Add the ElementHost control to the form's collection of child controls.
this.Controls.Add(host);
我正在使用 hello world 示例 prism 应用程序,截至今天,我的项目只有 1 个模块。
【问题讨论】:
标签: c# .net wpf winforms prism