-3
一个WinForms窗口在XML文件:如何显示在一个WPF网格或Viewbox控件
<Viewbox name="viewbox1"></Viewbox>
在C#代码隐藏:
windowformClass window1 = new windowformClass(); // this is the WinForms object, not WPF
viewbox1.Child = window1;
当我指定窗口1至viewbox1它显示了一个错误,不能将窗体窗体转换为System.Window.ElementUI
什么是正确的方法来做到这一点?
您需要使用WindowsFormsHost这个任务 – 0x4f3759df
你可以给我任何例如对于此> –
你应该避免在'WPF'应用程序中使用'WindowsForms' - 如果需要使用'WindowsFormsHost'正如其他人所提到的。为什么不把'WinForm'重构成'WPF'? –