Esempio n. 1
0
 static AdornerResources()
 {
     SystemEvents.UserPreferenceChanged += (UserPreferenceChangedEventHandler)((sender, e) =>
     {
         if (!AdornerResources._themeInUse || !AdornerResources.IsResourceCategory(e.Category))
         {
             return;
         }
         AdornerResources.EnsureResources(true);
     });
 }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 private static FontFamily GetFontFamily(ResourceKey key)
 {
     return((FontFamily)AdornerResources.FindResource(key));
 }
Esempio n. 4
0
 private static double GetFontSize(ResourceKey key)
 {
     return((double)AdornerResources.FindResource(key));
 }
Esempio n. 5
0
 private static ResourceKey CreateKey(string name)
 {
     return(AdornerResources.CreateResourceKey(typeof(AdornerFonts), name));
 }
Esempio n. 6
0
 static AdornerFonts()
 {
     AdornerResources.RegisterResources((LoadResourcesCallback)(() => (ResourceDictionary) new AdornerFontResourceDictionary()));
 }
Esempio n. 7
0
 private static Color GetColor(ResourceKey key)
 {
     return((Color)AdornerResources.FindResource(key));
 }
Esempio n. 8
0
 private static Brush GetBrush(ResourceKey key)
 {
     return((Brush)AdornerResources.FindResource(key));
 }
Esempio n. 9
0
 public static void Refresh()
 {
     AdornerResources.EnsureResources(true);
 }