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?
Yes you can, both Windows Forms within a WPF application, and WPF controls within Windows Forms.
For this job you must add this references to your Win-Form projects:
Help link
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With