Reference custom view in other project with custom

2019-09-15 04:16发布

I am making WPF program. I have project where I have custom TextBlock control with custom font (font-awesome), I add this project in references of another project and add this custom control in this new project but the font is not shown. It is just square. I have set build action as Resource and Do not copy to output directory. What am I doing wrong? Both projects are class libraries. And I use them in other project (all these done for Prism)

1条回答
▲ chillily
2楼-- · 2019-09-15 05:09

Make sure that the Build Action property of the font is set to Resource and that you reference the custom font using a pack URI as suggested here:

Using custom font in WPF application: http://geekswithblogs.net/Martinez/archive/2010/01/29/custom-font-in-wpf-application.aspx

<TextBlock FontFamily="pack://application:,,,/Folder1/#Katana">Text</TextBlock>

Please refer to the link for more information.

查看更多
登录 后发表回答