views:

53

answers:

1

Hi I am using Visual Studio 2008 targeting .net 3.5 framework. I need to add a WPF dialog to a Winforms project. I was thinking that by adding reference to PresentationCore, PresentationFramework and WindowsBase.dll and copying a WPF dialog from a test WPF project to the WinForms project in question should do the trick, but after that when I try to open in designer a WinForms dialog studio just crashes and closes. So basically the question is how to add a WPF dialog to a WinForms project? Thanks

A: 

Create the dialog as a WPF UserControl Library. Add it to the Windows Form application by using Project->Add Existing Item. Add an ElementHost component to the Windows Forms form. Set the HostedContent of the ElementHost to the WPF User Control.

This link may help you:

http://msdn.microsoft.com/en-us/library/system.windows.forms.integration.elementhost.aspx

Mamta Dalal
apparently the dragging seems to work now.your answer was how to use win wpf interop eg embedding a wpf control in a winforms.
MadalinaA