Beispiel #1
0
        // Used on reading from source. Get full list of rules for this control.
        public Dictionary <string, string> GetDefaultRules()
        {
            // Add themes first.
            var defaults        = new Dictionary <string, string>();
            var variantDefaults = new Dictionary <string, string>();

            if (_template != null)
            {
                // Default values from the variants take precedence over the base template
                var hasVariantDefaults = _variantName != null && _template.VariantDefaultValues.TryGetValue(_variantName, out variantDefaults);
                if (hasVariantDefaults)
                {
                    defaults.AddRange(variantDefaults);
                }

                defaults.AddRange(_template.InputDefaults.Where(kvp => !IsLocalizationKey(kvp.Value) && !(hasVariantDefaults && variantDefaults.ContainsKey(kvp.Key))));
            }

            defaults.AddRange(_theme.GetStyle(_styleName).Where(kvp => !IsLocalizationKey(kvp.Value)));

            if (_inResponsiveContext)
            {
                defaults.AddRange(DynamicProperties.GetDefaultValues(_templateName, this));
            }

            return(defaults);
        }
Beispiel #2
0
        // Used on reading from source. Get full list of rules for this control.
        public Dictionary <string, string> GetDefaultRules()
        {
            // Add themes first.
            var defaults = new Dictionary <string, string>();

            if (_template != null)
            {
                defaults.AddRange(_template.InputDefaults.Where(kvp => !IsLocalizationKey(kvp.Value)));
            }

            defaults.AddRange(_theme.GetStyle(_styleName).Where(kvp => !IsLocalizationKey(kvp.Value)));

            if (_inResponsiveContext)
            {
                defaults.AddRange(DynamicProperties.GetDefaultValues(_templateName, this));
            }

            return(defaults);
        }