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));
        }
Exemple #3
0
 private static FontFamily GetFontFamily(ResourceKey key)
 {
     return((FontFamily)AdornerResources.FindResource(key));
 }
Exemple #4
0
 private static double GetFontSize(ResourceKey key)
 {
     return((double)AdornerResources.FindResource(key));
 }
Exemple #5
0
 private static ResourceKey CreateKey(string name)
 {
     return(AdornerResources.CreateResourceKey(typeof(AdornerFonts), name));
 }
Exemple #6
0
 static AdornerFonts()
 {
     AdornerResources.RegisterResources((LoadResourcesCallback)(() => (ResourceDictionary) new AdornerFontResourceDictionary()));
 }
Exemple #7
0
 private static Color GetColor(ResourceKey key)
 {
     return((Color)AdornerResources.FindResource(key));
 }
Exemple #8
0
 private static Brush GetBrush(ResourceKey key)
 {
     return((Brush)AdornerResources.FindResource(key));
 }
 public static void Refresh()
 {
     AdornerResources.EnsureResources(true);
 }