我相当大的WinForm应用程序需要进行GUI大修,但我不能一次完成所有操作。我需要知道我是否可以慢慢地将WPF添加到其中,如果是,那该怎么办?
我可以添加WPF对话框吗?
我可以在WinForm中添加WPF“面板”,以便嵌入WPF元素吗?
修改
我是否可以执行相反的操作并将WinForm对话框放入我的WPF应用程序中?
答案 0 :(得分:10)
是的,您可以在WinForms应用程序中托管WPF控件:
Walkthrough: Hosting a 3-D WPF Composite Control in Windows Forms
Walkthrough: Hosting a Composite WPF Control in Windows Forms
答案 1 :(得分:6)
要在WinForm或win32应用程序中托管WPF窗口,你需要这条线。显示()你的WpfWindow:
System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(myWpfWindow);
答案 2 :(得分:0)