示例#1
0
        public static bool FromFile(string filename, out CustomAppTheme result)
        {
            var appTheme = new CustomAppTheme { Name = Path.GetFileNameWithoutExtension(filename) };

            try
            {
                if (!IsAppThemeDictionary(appTheme.ResourceDictionary))
                {
                    result = null;
                    return false;
                }
            }
            catch (XamlParseException)
            {
                result = null;
                return false;
            }

            result = appTheme;
            return true;
        }
示例#2
0
        public static bool FromFile(string filename, out CustomAppTheme result)
        {
            var appTheme = new CustomAppTheme {
                Name = Path.GetFileNameWithoutExtension(filename)
            };

            try
            {
                if (!IsAppThemeDictionary(appTheme.ResourceDictionary))
                {
                    result = null;
                    return(false);
                }
            }
            catch (XamlParseException)
            {
                result = null;
                return(false);
            }

            result = appTheme;
            return(true);
        }