I currently have a class library project that contains themes / templates and fonts (as resources). Then I refer to this project called Shared.UI in my main WPF application project.
I reference it using:
<ResourceDictionary Source="pack://application:,,,/Shared.UI;component/Skin.xaml" />
in the MergedDictionary tag.
The problem I encountered is that the main WPF application cannot use the fonts from the project where they are created as resources.
In my Shared.UI / Skins.xaml file, I have:
<Style TargetType="{x:Type Label}"> <Setter Property="FontFamily" Value="./resources/#Helvetica Neue" /> <Setter Property="Foreground" Value="{DynamicResource PrimaryBlue}" /> <Setter Property="FontSize" Value="12" /> </Style>
I assume that this does not work in my main WPF application because it looks in its own ./resources for #Helvetica Neue and does not find it (because it is in Shared.UI). I also tried explicitly referencing /Shared.UI;component/resources/#Helvetica Neue in the resource file, but this did not work for me.
source share