I want to use XAML to generate classes at compile time in a complete WinForms app. I don't want to use WPF although I am open to suggestions.
It seems like this should be possible but I can't find any information about exactly how. The closest thing I've found is this page: http://anoriginalidea.wordpress.com/2007/12/13/weird-science-defining-winforms-in-xaml/
Any ideas?
Hosting the Windows Forms Control xaml in the WPF Designer. In the Window element, add the following namespace mapping. The wf namespace mapping establishes a reference to the assembly that contains the Windows Forms control. In the Grid element add the following XAML.
Yes you can, both Windows Forms within a WPF application, and WPF controls within Windows Forms.
Add a WPF control to a Windows Form Your new WPF control is ready for use on the form. Windows Forms uses the ElementHost control to host WPF content. To add a WPF control to a Windows Form: Open Form1 in the Windows Forms Designer.
It's a common misconception that XAML = WPF, it doesn't. I'd suggest looking at CODE + MARKUP = Applications book by Petzold. Though I suspect that it won't cover Winforms per se. I've always planned to try this but never got round to it. Good luck.
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