当我执行以下操作时:
<!--Ресурсы приложения-->
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<FontFamily x:Key="DefaultFontFamily">/KingsSquare;component/Fonts/HeinrichScriptRegular.ttf#HeinrichScript</FontFamily>
<kingsSquare:Bootstrapper x:Key="Bootstrapper" />
<local:LocalizedStrings xmlns:local="clr-namespace:KingsSquare" x:Key="LocalizedStrings" />
</ResourceDictionary>
<ResourceDictionary Source="Resources/Styles/Buttons.xaml" />
<ResourceDictionary Source="Resources/Styles/Text.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
我无法在DefaultFontFamily
中使用Buttons.xaml
。 <{1}}内的样式中的以下行会引发一个异常,表示找不到该键。
Buttons.xaml
答案 0 :(得分:1)
看起来你没有在Buttons.xaml中添加MergeDictionaries。 看看这个答案:WP7, WP8 How to set several ResourceDictionaries to use custom FontFamilies