我知道你可以在 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 的更好方法,否则我会全力以赴!