1.添加引用:WindowsFormsIntegration.dll(负责整合WPF和Windows)、System.Windows.Forms.
2. 在XAML中引用添加的dll:
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
(也可以按照上面步骤添加自己要用到的控件引用)
3、在XAML添加控件:
<WindowsFormsHost Name="windowsFormsHost" Margin="0" Background="#FF323E34">
<wf:PictureBox Name="mainBox" Paint="PictureBox_Paint"></wf:PictureBox>
</WindowsFormsHost>