Exemplo n.º 1
0
        /// <summary>
        /// Registers theme so that it could be used as application theme.
        /// </summary>
        /// <param name="descriptor">Descriptor that describes the theme.</param>
        public void RegisterTheme(ThemeDescriptor descriptor)
        {
            if (descriptor == null)
            {
                throw new ArgumentNullException(SR.Get(SRID.ThemeDescriptorIsNull));
            }

            themes.Add(descriptor);
        }
Exemplo n.º 2
0
        static ThemeManager()
        {
            try
            {
                ResourceDictionary resources = new ResourceDictionary
                {
                    Source = new Uri(DefaultThemeResourceDictionary, UriKind.Relative)
                };

                _defaultThemeDescriptor = new ThemeDescriptor(DefaultThemeId, DefaultThemeName, resources);
            }
            catch (Exception e)
            {
                // TODO: add some kind of notification about failure
            }
        }