[C#/WINFORM] ElementHost 클래스 : WPF 복합 컨트롤 사용하기


■ WPF 복합 컨트롤을 만들고 ElementHost 컨트롤을 사용하여 Windows Forms 컨트롤 및 폼에서 호스트하는 방법을 보여준다. 두 개의 자식 컨트롤이 포함된 WPF UserControl을 구현한다. UserControl은 3차원 원뿔을 표시한다. 3D 개체를 렌더링하는 것은 Windows Forms보다 WPF를 사용하는 것이 훨씬 쉽다. 따라서 WPF UserControl 클래스를 호스트하여 Windows Forms에서 3D 그래픽을 만드는 것이 좋다.

[TestLibrary 프로젝트]

CustomControl.xaml

[TestProject 프로젝트]

MainForm.cs

TestSolution.zip