WPF add the font files to the resource file, and use the code in the background

Look at the results

 

 

1, the font file into the resource file, such as:

 

 

 After the addition, automatic generation

 

 

2, such as in the form xaml added:

 

 3, in a form corresponding to the cs xaml file designated as the field TextBlock

 

 Creating a field object, and specify the font file path where Resources refers to automatically generated resource folder, # fontawesome refers autologous name, not the font file name, how to view Font Name: "Double-click" open the font file, as

 

Guess you like

Origin www.cnblogs.com/zerommc/p/11607696.html