Reputation: 4196
I have an existing Windows Forms project.
Can I create an additional WPF/XAML Window (a full new window) within such a project?
Visual Studio does not offer that option, but I think that should be possible somehow, at least via code?
Upvotes: 6
Views: 1601
Reputation: 3580
For this job you must add this references to your Win-Form projects:
And to host WPF windows in WinForm or win32 apps you will need this line before you .Show()
your Wpf Window:
System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(myWpfWindow);
See http://msdn.microsoft.com/en-us/library/aa348549.aspx
Helpful link: Mixing WPF and WinForms
Upvotes: 6