I’ve created a .DLL in WPF. To use it in existing Windows Forms application I use ElementHost.
ElementHost eleHOst = new ElementHost();
UserWarps userWarps = new UserWarps();
eleHOst.Child = userWarps;
eleHOst.Dock = DockStyle.Fill;
UserWarps is in WPF .DLL which has been add-referenced. Now the file does lot of 3D manipulations. I’m also using Petzold.Media3D for 3D lines for wireframe modelling. Everything’s working fine except that WireLines of Petzold.Media3D is not drawing any lines. If I reference the DLL from other WPF applications everything’s fine, but hosting the UserControl of wpf in windows forms eliminates the lines/wireframes. Rest everything is perfect – MeshGeometry3D, Models, Visuals, functionalities etc.
Please suggest the way forward. could any alternative to ElementHost work? If it does then what is it?
Petzold has mentioned here that hosting wpf in Windows forms causes the Wire frames to disappear. He also posts a work around which is very simple and worked perfectly: