我有几个文本块,自定义字体系列可以正常工作:
FontFamily="{StaticResource CodeBold}"
这是 XAML 方式(一种工作方式),但我想在 C# 中做同样的事情,我想我错过了一些大事。
TextBlock txTop = new TextBlock();
txTop.FontFamily = new FontFamily("CodeBold");
如何在 C# 中做到这一点?
我有几个文本块,自定义字体系列可以正常工作:
FontFamily="{StaticResource CodeBold}"
这是 XAML 方式(一种工作方式),但我想在 C# 中做同样的事情,我想我错过了一些大事。
TextBlock txTop = new TextBlock();
txTop.FontFamily = new FontFamily("CodeBold");
如何在 C# 中做到这一点?