I have a Old windows form application and i don't want to convert it to wpf , i want to embed it inside my wpf application main window . How can i do this ?.
Also , How Can i transfer text between wpf and embeded WinForm using WindowsFormHost ?
You can use the WindowsFormsHost to add single Forms into an WPF application.
Windows forms are mainly based on a pixel, whereas WPF is not pixel-based, which allows the scalability of the UI part for the application. Windows forms support data binding in a limited way, whereas WPF is fully supported data binding. Windows forms are not used with different themes or skins.
So, the answer is no : you cannot add an XAML file in a WinForms project as is. You have to create a new System.
You'll want to use a WindowsFormsHost. Check this tutorial out (shows how to do WPF in WinForms and vice versa).
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