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

            StyleProperty property = null;

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

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

            return(property);
        }
示例#2
0
        internal void SetStyleProperty(StyleProperty property)
        {
            if (property == null || String.IsNullOrEmpty(property.Name))
            {
                return;
            }

            _styleProperties[property.Name] = property;
        }