参考

iconfont

1.找到想要的图标,添加入库
image.png

2.在购物车里,点击下载代码
image.png

在WPF中使用

1.将下载好的ttf文件移动到项目中:
image.png
2.移动到项目中
image.png
3.把文件属性的生成操作改为资源:
image.png
4.在App.xaml中添加资源,以便于引用:

  1. <Application.Resources>
  2. <FontFamily x:Key="iconfont">
  3. pack://application:,,,/TestProject;component/Font/#iconfont
  4. </FontFamily>
  5. </Application.Resources>

结构是pack://application:,,,/名称空间;component/路径/#ttf文件的字体名称

其中ttf文件的字体名称需要打开ttf文件确定。
image.png
5.在程序中使用:

<Button Content="&#xe67d;" FontFamily="{StaticResource iconfont}" FontSize="50"/>

效果:
image.png
图标的代码确定,可以通过下载的文件中的html文件确认:
image.png
image.png