本文主要是自己在学习过程中将用到的方法进行总结,方便新手快速入门。
引自:https://blog.youkuaiyun.com/kenjianqi1647/article/details/83216313
https://blog.youkuaiyun.com/lianchangshuai/article/details/6415241
1、首先添加两个dll文件,WindowsFormsIntegration.dll,System.Windows.Forms.dll,可搜索本机,添加引用。
2、NuGet中添加ZedGraph.dll的引用。
3、因ZedGraph是WinForm的控件,所以WPF中引用,需要在XAML中添加如下内容:
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:zedgraph="clr-namespace:ZedGraph;assembly=ZedGraph"
4、在WPF容器内添加WinForm控件的宿主容器,用来衔接WPF和WinForm。XAML代码如下所示:
<Grid>
<wfi:Window