static AdornerResources() { SystemEvents.UserPreferenceChanged += (UserPreferenceChangedEventHandler)((sender, e) => { if (!AdornerResources._themeInUse || !AdornerResources.IsResourceCategory(e.Category)) { return; } AdornerResources.EnsureResources(true); }); }
public static object FindResource(ResourceKey key) { if (key == null) { throw new ArgumentNullException("key"); } object resource; if (AdornerResources.FindResourceHelper(key, out resource)) { return(resource); } if (AdornerResources._queryElement == null) { AdornerResources._queryElement = new FrameworkElement(); } return(AdornerResources._queryElement.FindResource((object)key)); }
private static FontFamily GetFontFamily(ResourceKey key) { return((FontFamily)AdornerResources.FindResource(key)); }
private static double GetFontSize(ResourceKey key) { return((double)AdornerResources.FindResource(key)); }
private static ResourceKey CreateKey(string name) { return(AdornerResources.CreateResourceKey(typeof(AdornerFonts), name)); }
static AdornerFonts() { AdornerResources.RegisterResources((LoadResourcesCallback)(() => (ResourceDictionary) new AdornerFontResourceDictionary())); }
private static Color GetColor(ResourceKey key) { return((Color)AdornerResources.FindResource(key)); }
private static Brush GetBrush(ResourceKey key) { return((Brush)AdornerResources.FindResource(key)); }
public static void Refresh() { AdornerResources.EnsureResources(true); }