0
当我执行以下操作:有什么方法可以在资源字典中重复使用相同的自定义字体吗?
<!--Ресурсы приложения-->
<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>
我不能Buttons.xaml
使用DefaultFontFamily
。 Buttons.xaml
中的样式中的以下行将引发一个异常,表示未找到密钥。
<Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}"></Setter>