Пример #1
0
        static StyleProperty GetOrCreateStylePropertyByStyleName(StyleSheet styleSheet, StyleRule styleRule, string styleName)
        {
            var styleProperty = styleSheet.FindLastProperty(styleRule, styleName);

            if (styleProperty == null)
            {
                styleProperty = styleSheet.AddProperty(styleRule, styleName);
            }

            return(styleProperty);
        }
Пример #2
0
        public static void RemoveProperty(this StyleSheet styleSheet, StyleRule rule,
                                          string name, string undoMessage = null)
        {
            var property = styleSheet.FindLastProperty(rule, name);

            if (property == null)
            {
                return;
            }

            styleSheet.RemoveProperty(rule, property, undoMessage);
        }
Пример #3
0
 public static StyleProperty FindProperty(this StyleSheet styleSheet, StyleComplexSelector selector, string propertyName)
 {
     return(styleSheet.FindLastProperty(selector.rule, propertyName));
 }