我知道你可以在CodeBehind中使用类似以下代码的方式实现它...
#pragma warning disable 67
...
#pragma warning restore 67
但是有没有办法在XAML中做到这种事情呢?
例如,我在我的App.xaml中有以下内容...
<FontFamily x:Key="ExtendedFontFamily">Verdana</FontFamily>
它一直向我抛出这些VS错误(即使它成功构建)...
错误1 字体族类型'FontFamily'不可用作对象元素,因为它不是公共的或者没有定义一个无参构造函数或者类型转换器。C:\Users\jed.hunsaker\Documents\Work\NextGen\src\ESO.App.Reporting\ESO.App.Reporting.UI.Silverlight\App.xaml 8 4 ESO.App.Reporting.UI.Silverlight
以及...
错误2 字体族类型'FontFamily'不支持直接内容。C:\Users\jed.hunsaker\Documents\Work\NextGen\src\ESO.App.Reporting\ESO.App.Reporting.UI.Silverlight\App.xaml 8 42 ESO.App.Reporting.UI.Silverlight
除非你们知道在App.xaml中存储FontFamily的更好方法,否则我愿意听取建议!