예제 #1
0
        public override bool OnAttributeChange(string property)
        {
            // Note that base handles width, height, x, y etc.

            if (property == "href")
            {
                ReferencedPath = getAttribute("href");
            }
            else if (property == "startoffset")
            {
                StartOffset = Css.Value.Load(getAttribute("startoffset"));
            }
            else if (property == "method")
            {
                Method = ValueHelpers.GetPathMethod(getAttribute("method"));
            }
            else if (property == "spacing")
            {
                Spacing = ValueHelpers.GetPathSpacing(getAttribute("spacing"));
            }
            else if (!base.OnAttributeChange(property))
            {
                return(false);
            }


            return(true);
        }
예제 #2
0
        public override bool OnAttributeChange(string property)
        {
            // Note that base handles width, height, x, y etc.

            if (property == "viewbox")
            {
                // SVG viewbox
                Viewbox = ValueHelpers.GetViewbox(this["viewbox"]);
            }
            else if (property == "overflow")
            {
                // Overflow
                Overflow = ValueHelpers.GetOverflow(this["overflow"]);
            }
            else if (property == "preserveaspectratio")
            {
                // Aspect ratio
                AspectRatio = new AspectRatio(this["preserveaspectratio"]);
            }
            else if (!base.OnAttributeChange(property))
            {
                return(false);
            }


            return(true);
        }
예제 #3
0
        public override bool OnAttributeChange(string property)
        {
            // Global CSS properties. Width, height, fill, stroke, visibility, font-family,font-style etc are handled here.
            Css.CssProperty cssProperty = Css.CssProperties.Get(property);

            // Style refresh:
            if (Style.Computed.FirstMatch != null)
            {
                // This is a runtime attribute change.
                // We must consider if it's affecting the style or not:
                Style.Computed.AttributeChanged(property);
            }

            if (cssProperty != null)
            {
                // It's a CSS property! Apply to style:
                Css.Value value = ValueHelpers.Get(getAttribute(property));
                style[cssProperty] = value;
            }
            else if (property == "x")
            {
                style.left = getAttribute("x");
            }
            else if (property == "y")
            {
                style.top = getAttribute("y");
            }
            else if (!base.OnAttributeChange(property))
            {
                return(false);
            }

            return(true);
        }