c# - Loading a WinForms UserControl into a WPF UserControl? -
i have wpf application, , winforms usercontrol opentk 3d viewport. trying load opentk usercontrol wpf usercontrol, in turn loaded window. compiles, viewport not show.
my code is:
//winforms form
namespace opentk_viewport { public partial class form3dviewport : usercontrol { public form3dviewport() { initializecomponent(); } }
//wpf usercontrol
<grid> <wrappanel name="load3d" horizontalalignment="left" verticalalignment="top"/> </grid> public partial class form3dhost : system.windows.controls.usercontrol { public form3dhost() { initializecomponent(); // create interop host control. system.windows.forms.integration.windowsformshost host = new system.windows.forms.integration.windowsformshost(); // create maskedtextbox control. opentk_viewport.form3dviewport view = new opentk_viewport.form3dviewport(); // assign control host control's child. host.child = view; // add interop host control collection of child controls. load3d.children.add(host); } }
then load usercontrol into:
<xctk:wrappanel name="view3dloader" /> ui.form3dhost view = new ui.form3dhost(); view3dloader.children.add(view);
but nothing shows up, , yet there no error. missing?
thank you.
Comments
Post a Comment