【发布时间】:2010-11-14 11:53:46
【问题描述】:
我知道你可以在 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 的更好方法,否则我会全力以赴!
【问题讨论】:
标签: visual-studio xaml fonts app.xaml