public static bool FromFile(string filename, out CustomAccentColor result)
        {
            var accentColor = new CustomAccentColor { Name = new FileInfo(filename).Name };

            try
            {
                if (!ThemeManager.IsAccentDictionary(accentColor.ResourceDictionary))
                {
                    result = null;
                    return false;
                }
            }
            catch (XamlParseException)
            {
                result = null;
                return false;
            }

            result = accentColor;
            return true;
        }
Exemple #2
0
        public static bool FromFile(string filename, out CustomAccentColor result)
        {
            var accentColor = new CustomAccentColor {
                Name = new FileInfo(filename).Name
            };

            try
            {
                if (!ThemeManager.IsAccentDictionary(accentColor.ResourceDictionary))
                {
                    result = null;
                    return(false);
                }
            }
            catch (XamlParseException)
            {
                result = null;
                return(false);
            }

            result = accentColor;
            return(true);
        }