我有一个现有的
Windows窗体项目.
我可以在这样的项目中创建一个额外的WPF / XAML窗口(一个全新的窗口)吗?
Visual Studio不提供该选项,但我认为应该可能以某种方式,至少通过代码?
对于此作业,您必须将此引用添加到Win-Form项目:
> PresentationCore
> PresentationFramework
> WindowsBase
> System.Xaml
Help link
要在WinForm或win32应用程序中托管WPF窗口,您需要在此之前使用此行.显示()您的Wpf窗口:
System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(myWpfWindow);
见http://msdn.microsoft.com/en-us/library/aa348549.aspx
有用的链接:Mixing WPF and WinForms