在 App.xaml 中为应用程序设置 FontFamily 和 FontSize
如何在 App.xaml 中设置应用程序的 FontFamily 和 FontSize?
How can I set the FontFamily and FontSize for the application in App.xaml?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了 David Padbury 在 2008 年发表的一篇博客文章(遗憾的是已经不存在了),其中讨论了这个问题以及如何从代码中更改它。基本上,您覆盖了元数据属性,这些属性合并了对现有值的更改。
还有这个 MSDN 论坛帖子 它解释了如何在 XAML 中以两种方式执行此操作。
首先,为
Control
类定义“全局”样式,然后使用
BaseOn
属性将其应用到其他控件。您可以设置系统字体:
./#Segoe UI
11
正常
虽然我可能不会推荐这个。
I've found a blog post by David Padbury from 2008 (sadly no longer in existence) which went into this and how to change it from code. Basically you override the meta data properties which merges in your changes to the existing values.
There's also this MSDN forum post which explains how to do it in XAML in two ways.
Firstly you define a "global" style for the
Control
classand then use the
BasedOn
property to apply that to other controls.You can set the system fonts:
./#Segoe UI
<System:Double x:Key="{x:Static SystemFonts.MenuFontSizeKey}">11</System:Double>
Normal
Though I probably wouldn't recommend this.