Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hosting WPF controls in Winforms

My Application is developed using WinForms. Is it possible to host the WPF DataGrid, Button, ListBox, ComboBox etc in WinForms User Controls?

like image 335
WPF Learner Avatar asked Jun 03 '13 16:06

WPF Learner


People also ask

Can you mix WPF and WinForms?

Yes you can, both Windows Forms within a WPF application, and WPF controls within Windows Forms.

Can I use XAML in Windows Forms?

XAML format is for use with WPF/Silverlight. Windows Forms uses only . cs files for the definition of UI elements. So, the answer is no : you cannot add an XAML file in a WinForms project as is.


1 Answers

Yes, it's possible using the ElementHost control in Winforms and hosting WPF content inside of it.

like image 129
Federico Berasategui Avatar answered Oct 20 '22 01:10

Federico Berasategui