Exemplo n.º 1
0
        static Theme Load(string filename)
        {
            try {
                var root = XDocument.Load(filename).Root;
                if (root.Name != "theme")
                    return null;

                var theme = new Theme(root);
                if (string.IsNullOrEmpty(theme.Name) || string.IsNullOrEmpty(theme.MenuName))
                    return null;

                themes[theme.Name] = theme;
                return theme;
            }
            catch (Exception) {
                Debug.Fail(string.Format("Failed to load file '{0}'", filename));
            }
            return null;
        }
Exemplo n.º 2
0
 public SetThemeCommand(Theme theme)
 {
     this.theme = theme;
 }
Exemplo n.º 3
0
 public static void SwitchThemeIfNecessary()
 {
     if (Theme.IsHighContrast != IsHighContrast)
         Theme = GetThemeOrDefault(CurrentDefaultThemeName);
 }