UI
WPF-UI
https://github.com/lepoco/wpfui
HandyControl
https://github.com/HandyOrg/HandyControl
图标
Font Awesome
下载压缩包
从 Font Awesome 下载字体图标
解压下载的文件
在项目中引用
将字体添加至项目中
添加静态资源
1 2 3 4 5 6 7 8 9
| <Style x:Key="FA_Regular"> <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Resources/#Font Awesome 6 Free Regular" /> </Style> <Style x:Key="FA_Solid"> <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Resources/#Font Awesome 6 Free Solid" /> </Style> <Style x:Key="FA_Brands"> <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Resources/#Font Awesome 6 Brands Regular" /> </Style>
|
使用方法
在网站搜索图标
点击搜索结果,复制 Unicode
以该图标为例,由于 XAML 不能识别“\”,所以您应该输入“”而不是“\#f007”
示例
1 2 3 4 5
| <WrapPanel> <TextBlock Text="" FontSize="24" Margin="5" Style="{StaticResource FA_Solid}"/> <TextBlock Text="" FontSize="24" Margin="5" Style="{StaticResource FA_Regular}"/> <TextBlock Text="" FontSize="24" Margin="5" Style="{StaticResource FA_Brands}"/> </WrapPanel>
|
备注
专业版用户请使用:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <Style x:Key="FA_Solid"> <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Resources/#Font Awesome 6 Pro Solid" /> </Style> <Style x:Key="FA_Regular"> <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Resources/#Font Awesome 6 Pro Regular" /> </Style> <Style x:Key="FA_Light"> <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Resources/#Font Awesome 6 Pro Light" /> </Style> <Style x:Key="FA_Thin"> <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Resources/#Font Awesome 6 Pro Thin" /> </Style> <Style x:Key="FA_Duotone"> <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Resources/#Font Awesome 6 Duotone Solid" /> </Style> <Style x:Key="FA_Brands"> <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Resources/#Font Awesome 6 Brands Regular" /> </Style>
|