I have a Controls.ItemsControl
(actually a HelixViewport3D
) and would like to add it inside a Forms.UserControl
.
I already tried this.Controls.Add(new HelixViewport3D());
Where this is a derivative from UserControl
however this resulted in an error HelixToolkit.Wpf.HelixViewport3D' to 'System.Windows.Forms.Control
. Which makes sense given that they don't inherit anything from one another. Is there a sort of wrapper class in these situations?
using HelixToolkit.Wpf;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
public partial class HelixForm : Form
{
public HelixForm()
{
InitializeComponent();
var _3Dcntr = new HelixViewport3D();
this.Controls.Add(_3Dcntr);//doesn't work
//what we worked out so far
var elemHost = new ElementHost();
}
}
I have also noticed that it's supposed to be possible to host a WPF in a winform using ElementHost.Child but adding this variable/function cannot be found in my example code(missing something?), System.Windows.Forms.Integration.ElementHost tells me that System.Windows.Forms.Integration is missing.