Exemplo n.º 1
0
 public void InstallSkinResources(SkinResources skinResources)
 {
     // Setup the resource chain and use the default skin as last fallback
     skinResources.SetupResourceChain(_skins, DefaultSkin);
     // Initialize SkinContext with new resource bundle
     SkinContext.SkinResources = skinResources;
     skinResources.InitializeStyleResourceLoading(); // Initializes the resource file dictionary
     Fonts.FontManager.Load(skinResources);          // Needs an initialized resource file dictionary - loads font files
     skinResources.LoadAllStyleResources();          // Needs the FontManager
     // Notify others that we loaded a new skin or theme
     SkinResourcesMessaging.SendSkinResourcesMessage(SkinResourcesMessaging.MessageType.SkinOrThemeChanged);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Will trigger the actual initialization of styles. Before calling this method,
        /// the style loading has to be initialized by calling <see cref="InitializeStyleResourceLoading"/>.
        /// </summary>
        internal virtual void LoadAllStyleResources()
        {
            // Load all pending resources. We use this complicated way because during the loading of
            // each style resource, another dependent resource might be requested to be loaded first.
            // Thats why we have to make use of this mixture of sequential and recursive
            // loading algorithm.
            KeyValuePair <string, PendingResource> kvp;

            while ((kvp = _pendingStyleResources.FirstOrDefault(
                        kvpArg => kvpArg.Value.State == LoadState.Pending)).Key != null)
            {
                LoadStyleResource(kvp.Key, false);
            }
            if (_inheritedSkinResources != null)
            {
                _inheritedSkinResources.LoadAllStyleResources();
            }
            _pendingStyleResources = null;
        }
Exemplo n.º 3
0
 public void InstallSkinResources(SkinResources skinResources)
 {
   // Setup the resource chain and use the default skin as last fallback
   skinResources.SetupResourceChain(_skins, DefaultSkin);
   // Initialize SkinContext with new resource bundle
   SkinContext.SkinResources = skinResources;
   skinResources.InitializeStyleResourceLoading(); // Initializes the resource file dictionary
   Fonts.FontManager.Load(skinResources); // Needs an initialized resource file dictionary - loads font files
   skinResources.LoadAllStyleResources(); // Needs the FontManager
   // Notify others that we loaded a new skin or theme
   SkinResourcesMessaging.SendSkinResourcesMessage(SkinResourcesMessaging.MessageType.SkinOrThemeChanged);
 }