Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
While writing the question I did find one hacky solution which works, and which I will use unless someone has an alternative. Create a codebehind file for the theme: using System; using System.W...
Answer
#1: Initial revision
While writing the question I did find one hacky solution which works, and which I will use unless someone has an alternative. Create a codebehind file for the theme: using System; using System.Windows; using System.Windows.Media; namespace Anonymised.Theme { public partial class DefaultTheme : ResourceDictionary { static DefaultTheme() { var tajawal = new FontFamily(new Uri("pack://application:,,,/Anonymised.Theme;Component/"), "./Themes/#Tajawal"); FrameworkElement.StyleProperty.OverrideMetadata(typeof(Window), new FrameworkPropertyMetadata { DefaultValue = new Style { Setters = { new Setter(Window.FontFamilyProperty, tajawal), } } }); } } } Ensure it's used by adding x:Class="Anonymised.Theme.DefaultTheme" to the attributes of the `ResourceDictionary` in `DefaultTheme.xaml`. Then this will be executed while each application is initialising its own resource dictionary, *before* it creates any windows.