示例#1
0
        public IStyleProperty SetStyleProperty(string name, bool value)
        {
            if (String.IsNullOrEmpty(name))
            {
                return(null);
            }

            StyleBooleanProperty property = null;

            if (Contains(name))
            {
                property = _styleProperties[name] as StyleBooleanProperty;
                if (property != null && property.BooleanValue != value)
                {
                    property.BooleanValue = value;
                }
            }

            if (property == null)
            {
                property = new StyleBooleanProperty(name, value);
                _styleProperties[name] = property;
            }

            return(property);
        }
示例#2
0
        protected bool LoadStyleBooleanProperty(XmlElement parentElement, string propertyName)
        {
            XmlElement propertyElement = parentElement[propertyName];

            if (propertyElement != null)
            {
                string value = null;
                if (LoadStringFromChildElementInnerText("Value", propertyElement, ref value))
                {
                    StyleBooleanProperty property = new StyleBooleanProperty(propertyName, false);
                    property.Value = value;
                    SetStyleProperty(property);
                    return(true);
                }
            }

            return(false);
        }