0

When I do the following:

<!--Ресурсы приложения-->
<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>

I can't use DefaultFontFamily in Buttons.xaml. The following line in a style inside Buttons.xaml throws an exception which says that the key is not found.

 <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}"></Setter>
embert
  • 7,336
  • 10
  • 49
  • 78
EngineerSpock
  • 2,575
  • 4
  • 35
  • 57

1 Answers1

1

Look like you didn't add MergeDictionaries in Buttons.xaml. Look this answer:WP7, WP8 How to set several ResourceDictionaries to use custom FontFamilies

Community
  • 1
  • 1
d.lavysh
  • 1,404
  • 14
  • 23