Exemplo n.º 1
0
        static StyleProperty GetOrCreateStylePropertyByStyleName(StyleSheet styleSheet, StyleRule styleRule, string styleName)
        {
            var styleProperty = styleSheet.FindProperty(styleRule, styleName);

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

            return(styleProperty);
        }
        public static void RemoveProperty(this StyleSheet styleSheet, StyleRule rule,
                                          string name, string undoMessage = null)
        {
            var property = styleSheet.FindProperty(rule, name);

            if (property == null)
            {
                return;
            }

            styleSheet.RemoveProperty(rule, property, undoMessage);
        }
Exemplo n.º 3
0
 public static StyleProperty FindProperty(this StyleSheet styleSheet, StyleComplexSelector selector, string propertyName)
 {
     return(styleSheet.FindProperty(selector.rule, propertyName));
 }